Class CommandQueueManager
- java.lang.Object
-
- com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager
-
public class CommandQueueManager extends java.lang.ObjectManages the queuing of dangerous commands that require
/mv confirmbefore executing.Each sender can only have one command in queue at any given time. When a queued command is added for a sender that already has a command in queue, it will replace the old queued command.
-
-
Constructor Summary
Constructors Constructor Description CommandQueueManager(@NotNull MultiverseCore plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToQueue(QueuedCommand queuedCommand)Adds aQueuedCommandinto queue.booleanremoveFromQueue(@NotNull org.bukkit.command.CommandSender sender)Since only one command is stored in queue per sender, we remove the old one.booleanrunQueuedCommand(@NotNull org.bukkit.command.CommandSender sender)Runs the command in queue for the given sender, if any.
-
-
-
Constructor Detail
-
CommandQueueManager
public CommandQueueManager(@NotNull @NotNull MultiverseCore plugin)
-
-
Method Detail
-
addToQueue
public void addToQueue(QueuedCommand queuedCommand)
Adds aQueuedCommandinto queue.- Parameters:
queuedCommand- The queued command to add.
-
runQueuedCommand
public boolean runQueuedCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender)Runs the command in queue for the given sender, if any.- Parameters:
sender-CommandSenderthat confirmed the command.- Returns:
- True if queued command ran successfully, else false.
-
removeFromQueue
public boolean removeFromQueue(@NotNull @NotNull org.bukkit.command.CommandSender sender)Since only one command is stored in queue per sender, we remove the old one.- Parameters:
sender- TheCommandSenderthat executed the command.- Returns:
- True if queue command is removed from sender successfully, else false.
-
-