Class CommandQueueManager
- java.lang.Object
-
- com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager
-
public class CommandQueueManager extends java.lang.Object
Manages the queuing of dangerous commands that require
/mv confirm
before 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 void
addToQueue(QueuedCommand queuedCommand)
Adds aQueuedCommand
into queue.boolean
removeFromQueue(@NotNull org.bukkit.command.CommandSender sender)
Since only one command is stored in queue per sender, we remove the old one.boolean
runQueuedCommand(@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 aQueuedCommand
into 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
-CommandSender
that 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
- TheCommandSender
that executed the command.- Returns:
- True if queue command is removed from sender successfully, else false.
-
-