Class PressurePlate

java.lang.Object
me.block2block.hubparkour.api.plates.PressurePlate
Direct Known Subclasses:
BorderPoint, Checkpoint, EndPoint, ExitPoint, RestartPoint, StartPoint

public abstract class PressurePlate extends Object
Represents a generic pressure plate.

WARNING: never create PressurePlate objects. Always extend this class.

  • Field Details

  • Constructor Details

  • Method Details

    • setParkour

      public void setParkour(IParkour parkour)
      Set the parkour the pressure plate belongs to.

      WARNING: It is not recommended that you use this once the parkour has been setup.

      Parameters:
      parkour - the parkour it belongs to.
    • getLocation

      public Location getLocation()
      The location the pressure plate it located.
      Returns:
      the location of the pressure plate.
    • getType

      public abstract int getType()
      The type of pressure plate. This is just an arbitrary value.

      Default ID's: 0 - Start Point 1 - End Point 2 - Restart Point 3 - Checkpoint 4 - Border Point 5 - Exit Point

      Returns:
      the pressure plate type
    • getMaterial

      public Material getMaterial()
      Get the type of material the pressure plate has.
      Returns:
      Material type.
    • placeMaterial

      public void placeMaterial()
      Places the pressure plate material on the block the pressure plate is located at.
    • removeMaterial

      public void removeMaterial()
      Remove the material by setting it to air.
    • getParkour

      public IParkour getParkour()
      Get the parkour the pressure plate belongs to.
      Returns:
      the parkour it belongs to.
    • getRewards

      public List<String> getRewards()
      Retrieves the commands associated with the pressure plate.
      Returns:
      a list of commands, represented as strings, or null if this is not a checkpoint.
    • setRewards

      public void setRewards(List<String> rewards)
      Sets the commands associated with the pressure plate. Does nothing if this is not a checkpoint.
      Parameters:
      rewards - a list of commands, represented as strings, to be associated with this pressure plate.