Interface Ride


public interface Ride
Represents a single Ride
  • Method Details

    • getName

      String getName()
      Returns:
      this ride's Name / ID
    • getType

      String getType()
      Returns:
      a string representing the ride type
    • getRiders

      List<org.bukkit.entity.Player> getRiders()
      Returns:
      an ArrayList containing the players currently on the ride.
    • getRiderSeat

      int getRiderSeat(org.bukkit.entity.Player player)
      Find which seat a rider is in Will throw an IllegalArgumentException if player is not on ride
      Parameters:
      player - the player whose seat you want to find
      Returns:
      the index of the seat (counts from 0)
    • getConfigOptions

      List<String> getConfigOptions()
      Returns:
      an ArrayList containing the names of all ride settings
    • getConfigOptionTypes

      HashMap<String,Class<?>> getConfigOptionTypes()
      Returns:
      a map containing all ride settings and their type
    • getRideSetting

      Object getRideSetting(String key)
      Get the value of a ride setting
      Parameters:
      key - the name of the setting
      Returns:
      the current value of the setting
    • setRideSetting

      void setRideSetting(String key, Object value)
      Set a ride's setting
      Parameters:
      key - the name of the setting
      value - the new value for the setting
      Throws:
      IllegalArgumentException - if value is not correct type for given key
      IndexOutOfBoundsException - if the key does not exist
    • enable

      boolean enable()
      Enable the ride
      Returns:
      true if enabled successfully, false if encountered an issue.
    • disable

      void disable()
      Disable the ride
    • startRide

      void startRide(RideStartEvent.StartReason startReason)
      Starts the movement of a ride
    • stopRide

      void stopRide(RideStopEvent.RideStopReason stopReason)
      Stop a ride (immediately), and kicks players out
    • firstAvailableSeat

      int firstAvailableSeat()
      Finds the first available seat on the ride
      Returns:
      the index of the seat, -1 if the ride is full
    • addPlayer

      boolean addPlayer(org.bukkit.entity.Player player, boolean bypassCost, int seatNumber, RideEnterEvent.EnterMethod enterMethod)
      Add a new player to the ride Adds to the ride queue if the ride is full (still returns true)
      Parameters:
      player - the player to add
      bypassCost - whether to ignore the price
      seatNumber - the seat index to add the player true
      enterMethod - the method used to join the ride
      Returns:
      true if successful, false if failed (i.e. seat taken, not enough money, no permissions)
    • addPlayer

      default boolean addPlayer(org.bukkit.entity.Player player, boolean bypassCost, RideEnterEvent.EnterMethod enterMethod)
      Add a new player to the ride, putting them in the first available seat
      Parameters:
      player - the player to add
      bypassCost - whether to ignore the price
      Returns:
      true if successful, false if failed
    • addPlayer

      default boolean addPlayer(org.bukkit.entity.Player player)
      Add a new player to the ride, putting them in the first available seat Ride price, permissions will be checked
      Parameters:
      player - the player to add
      Returns:
      true if successful, false if failed
    • ejectPlayer

      void ejectPlayer(org.bukkit.entity.Player player, RideExitEvent.ExitReason reason)
      Remove a player from the ride (forcefully) Uses the ride's EXIT_TELEPORT_RUNNING option to determine whether to teleport or eject the player at their seat
      Parameters:
      player - the player to eject
      reason - the reason for exiting (ie. Command / Ride end etc)
    • isEnabled

      boolean isEnabled()
      Returns:
      whether this ride is currently enabled.
    • isRunning

      boolean isRunning()
      Returns:
      whether the ride is currently running (i.e. moving)
    • isCountdownStarted

      boolean isCountdownStarted()
      Returns:
      whether the ride's countdown (for automatically starting) has begun
    • getRemainingCountdownTime

      int getRemainingCountdownTime()
      Returns:
      how long is left on the ride's countdown timer. -1 if countdown hasn't started