Interface IHubParkourPlayer


public interface IHubParkourPlayer
Represents a player in a parkour.
  • Method Details

    • checkpoint

      void checkpoint(Checkpoint checkpoint)
      What happens when a user reaches a checkpoint.
      Parameters:
      checkpoint - the checkpoint reached.
    • end

      What happens when the player has finished the parkour
      Parameters:
      cause - The cause of the end. Null if this was a parkour completed.
    • getLastReached

      int getLastReached()
      Gets the last reached checkpoint
      Returns:
      the number of the last reached checkpoint.
    • getParkour

      IParkour getParkour()
      Gets the parkour this player is currently in.
      Returns:
      the parkour.
    • getPlayer

      Player getPlayer()
      Get the org.bukkit.entity.Player object of the player.
      Returns:
      the Bukkit Player object.
    • restart

      void restart()
      When happens when the player restarts the parkour.
    • getPrevious

      long getPrevious()
      Get the time they got on the last time they completed the parkour.
      Returns:
      the time they received in ms.
    • getStartTime

      long getStartTime()
      Get the timestamp of when they started the parkour.
      Returns:
      the timestamp in ms.
    • getParkourItems

      List<ParkourItem> getParkourItems()
      Get a list of all of the parkour items. Even if items are disabled, they will still be present in this list, but will not give the item if disabled.
      Returns:
      the list of parkour items.
    • startParkour

      void startParkour()
      Give a player all of the parkour items, and update the player state.
    • setToPrevState

      void setToPrevState()
      Resets all player states that were modified when starting the parkour.
    • getActionBarTask

      BukkitTask getActionBarTask()
      Get the active action bar task.
      Returns:
      the BukkitTask object if it is active, null if not.
    • getSplitTimes

      Map<Integer,Long> getSplitTimes()
      Get a map of all split times, mapped by checkpoint number.
      Returns:
      Map of all split times.
    • getCurrentSplit

      long getCurrentSplit()
      Get the time of the users current split.
      Returns:
      The time of the split.
    • getPrevGamemode

      GameMode getPrevGamemode()
      Get the gamemode the player was in before the parkour was started.
      Returns:
      The gamemode the player was in.
    • getPrevHealth

      double getPrevHealth()
      Get the health the player was at before the parkour was started.
      Returns:
      The health the player was at.
    • getPrevHunger

      int getPrevHunger()
      Get the hunger the player was at before the parkour was started.
      Returns:
      The hunger the player was at.
    • getParkourRun

      ParkourRun getParkourRun()
      Get the user's current parkour run.
      Returns:
      the current parkour run.
    • hasTouchedGround

      boolean hasTouchedGround()
      Whether the user has touched the ground since their last jump.
      Returns:
      whether they have touched the ground.
    • touchedGround

      void touchedGround()
      Executed when the user touches the ground.
    • leftGround

      void leftGround()
      Executed when the user leaves the ground.