Class ToolUserManager
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.api.restartable.Restartable
nl.pim16aap2.animatedarchitecture.core.managers.ToolUserManager
- All Implemented Interfaces:
IRestartable
Represents a class that manages
ToolUsers.-
Method Summary
Modifier and TypeMethodDescriptionvoidabortToolUser(UUID playerUUID) Stops and removes a player (defined by theirUUID) if it is currently active.voidabortToolUser(ToolUser toolUser) Stops and removes aToolUser.booleancancelToolUser(UUID uuid) Cancels an active tool user process for a player.booleancancelToolUser(IPlayer player) Cancels an active tool user process for a player.getToolUser(UUID uuid) Gets theToolUserfor a player.getToolUser(IPlayer player) Gets theToolUserfor a player.booleanisToolUser(UUID uuid) Checks if a player is currently a tool user.booleanisToolUser(IPlayer player) Checks if a player is currently a tool user.voidregisterToolUser(ToolUser toolUser) Registers aToolUserfor a player.voidshutDown()Handles a shutdown.voidstartToolUser(ToolUser toolUser, int time) Starts a timer for aToolUser.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.api.restartable.IRestartable
initialize
-
Method Details
-
registerToolUser
Registers aToolUserfor a player.- Parameters:
toolUser- TheToolUserto register.
-
isToolUser
Checks if a player is currently a tool user. SeeisToolUser(UUID).- Parameters:
player- The player to check.- Returns:
- True if the player is a tool user.
-
isToolUser
Checks if a player is currently a tool user. A player is a tool user if they have an activeToolUserprocess.- Parameters:
uuid- The UUID of the player to check.- Returns:
- True if the player is a tool user.
-
getToolUser
Gets theToolUserfor a player. SeegetToolUser(UUID). -
getToolUser
Gets theToolUserfor a player. -
cancelToolUser
Cancels an active tool user process for a player.- Parameters:
player- The player whose tool user process to cancel.- Returns:
- True if a process was cancelled.
-
cancelToolUser
Cancels an active tool user process for a player.- Parameters:
uuid- The UUID of the player whose tool user process to cancel.- Returns:
- True if a process was cancelled.
-
shutDown
public void shutDown()Description copied from interface:IRestartableHandles a shutdown. -
startToolUser
Starts a timer for aToolUser. After the provided number of seconds have passed, theToolUserwill be aborted if this h- Parameters:
toolUser- TheToolUserfor which to start the timer.time- The amount of time (in milliseconds).
-
abortToolUser
-
abortToolUser
Stops and removes aToolUser. "Stop" here means that it will make sure to properly clean up theToolUser.- Parameters:
toolUser- TheToolUserto stop and remove.
-