Package com.melluh.servertours.api
Interface TouringPlayer
public interface TouringPlayer
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanExit()Checks whether the player is currently allowed to exit.voidexit()Stops playback of the tour for the player.Gets the route point the player is currently viewing.org.bukkit.LocationGets where the player will be teleported to when they finish the tour.org.bukkit.entity.PlayerGets the Bukkit player instance.floatGets the progress this player has made over the current point.getRoute()Gets the route this player is viewing.floatGets the progress this player has made over the whole tour.booleanChecks whether the action bar message is enabled.booleanChecks whether the player can exit by moving.booleanChecks whether the progress bar is enabled.booleanChecks whether this player is waiting for confirmation to continue.voidsetActionBarEnabled(boolean actionBarEnabled) Sets whether the action bar is enabled.voidsetCanExit(boolean canExit) Sets whether the player should be allowed to exit.voidsetCurrentPoint(int index) Changes the point the player is currently viewing.voidsetCurrentPoint(RoutePoint point) Changes the point the player is currently viewing.voidsetExitByMoving(boolean exitByMoving) Sets whether the player is able to exit by moving.voidsetExitLocation(org.bukkit.Location exitLocation) Sets wherer the player will be teleported when they finish the tour.voidsetProgressBarEnabled(boolean progressBarEnabled) Sets whether the progress bar is enabled.voidsetWaitingForConfirmation(boolean waitingForConfirmation) Sets whether this player is waiting for confirmation to continue.
-
Method Details
-
exit
void exit()Stops playback of the tour for the player. ARoutePlaybackEndEventwill be fired withRoutePlaybackEndEvent.EndReason.API. -
getRouteProgress
float getRouteProgress()Gets the progress this player has made over the whole tour.- Returns:
- the progress, in the range 0.0-1.0
-
getPointProgress
float getPointProgress()Gets the progress this player has made over the current point.- Returns:
- the progress, in the range 0.0-1.0
-
setCurrentPoint
void setCurrentPoint(int index) Changes the point the player is currently viewing. By modifying this, the player will start back at the beginning of that route point. If applicable, the point title and description will also be sent and any applicable point commands will be run.- Parameters:
index- the point index
-
setCurrentPoint
Changes the point the player is currently viewing. By modifying this, the player will start back at the beginning of that route point. If applicable, the point title and description will also be sent and any applicable point commands will be run.- Parameters:
point- the point
-
getCurrentPoint
RoutePoint getCurrentPoint()Gets the route point the player is currently viewing.- Returns:
- the point
-
getRoute
Route getRoute()Gets the route this player is viewing.- Returns:
- the route
-
getPlayer
org.bukkit.entity.Player getPlayer()Gets the Bukkit player instance.- Returns:
- the bukkit player
-
isWaitingForConfirmation
boolean isWaitingForConfirmation()Checks whether this player is waiting for confirmation to continue. If this is the case, the player will have been prompted to press their mouse, press a key, or click a button in chat, depending on the point's settings.- Returns:
trueif waiting for confirmation
-
setWaitingForConfirmation
void setWaitingForConfirmation(boolean waitingForConfirmation) Sets whether this player is waiting for confirmation to continue. When you set this totrue, playback will be paused and the player will be prompted to perform an action, depending on the current point's settings. If setting tofalseinstead, playback will be resumed if it was paused.- Parameters:
waitingForConfirmation- whether to wait for confirmation
-
isProgressBarEnabled
boolean isProgressBarEnabled()Checks whether the progress bar is enabled. The progress bar shows the player how far along the tour route they are, by using the XP bar.- Returns:
trueif the progress bar is enabled
-
setProgressBarEnabled
void setProgressBarEnabled(boolean progressBarEnabled) Sets whether the progress bar is enabled. The progress bar shows the player how far along the tour route they are, by using the XP bar.- Parameters:
progressBarEnabled- whether the progress should be enabled
-
isActionBarEnabled
boolean isActionBarEnabled()Checks whether the action bar message is enabled. This shows the player a constant action bar configured in the language config while they are viewing a tour route.- Returns:
trueif the action bar is enabled
-
setActionBarEnabled
void setActionBarEnabled(boolean actionBarEnabled) Sets whether the action bar is enabled. When enabled, this shows the player a constant action bar configured in the language config while they are viewing a tour route.- Parameters:
actionBarEnabled- whether the action bar should be enabled
-
canExit
boolean canExit()Checks whether the player is currently allowed to exit. The player can only exit the tour themselves (by pressing SHIFT) if this is enabled.- Returns:
trueif the player is allowed to exit
-
setCanExit
void setCanExit(boolean canExit) Sets whether the player should be allowed to exit. The player can only exit the tour themselves (by pressing SHIFT) if this is enabled.- Parameters:
canExit- whether the player is allowed to exit the tour
-
isExitByMoving
boolean isExitByMoving()Checks whether the player can exit by moving. If enabled, the player can exit the tour by pressing the WASD keys, in addition to being able to exit by pressing SHIFT.- Returns:
trueif this is enabled
-
setExitByMoving
void setExitByMoving(boolean exitByMoving) Sets whether the player is able to exit by moving. If enabled, the player can exit the tour by pressing the WASD keys, in addition to being able to exit by pressing SHIFT.- Parameters:
exitByMoving- whether the player can exit by moving
-
getExitLocation
org.bukkit.Location getExitLocation()Gets where the player will be teleported to when they finish the tour. By default, this is the location they entered the tour from.- Returns:
- the exit location
-
setExitLocation
void setExitLocation(org.bukkit.Location exitLocation) Sets wherer the player will be teleported when they finish the tour.- Parameters:
exitLocation- the new exit location
-