Interface IHubParkourPlayer
public interface IHubParkourPlayer
Represents a player in a parkour.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcheckpoint(Checkpoint checkpoint) What happens when a user reaches a checkpoint.voidWhat happens when the player has finished the parkourGet the active action bar task.longGet the time of the users current split.intGets the last reached checkpointGets the parkour this player is currently in.Get a list of all of the parkour items.Get the user's current parkour run.Get theorg.bukkit.entity.Playerobject of the player.Get the gamemode the player was in before the parkour was started.doubleGet the health the player was at before the parkour was started.intGet the hunger the player was at before the parkour was started.longGet the time they got on the last time they completed the parkour.Get a map of all split times, mapped by checkpoint number.longGet the timestamp of when they started the parkour.booleanWhether the user has touched the ground since their last jump.voidExecuted when the user leaves the ground.voidrestart()When happens when the player restarts the parkour.voidResets all player states that were modified when starting the parkour.voidGive a player all of the parkour items, and update the player state.voidExecuted when the user touches the ground.
-
Method Details
-
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
-
getPlayer
Player getPlayer()Get theorg.bukkit.entity.Playerobject 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
-
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
-
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.
-