Class 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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addToQueue​(QueuedCommand queuedCommand)
      Adds a QueuedCommand 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandQueueManager

        public CommandQueueManager​(@NotNull
                                   @NotNull MultiverseCore plugin)
    • Method Detail

      • addToQueue

        public void addToQueue​(QueuedCommand queuedCommand)
        Adds a QueuedCommand 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 - The CommandSender that executed the command.
        Returns:
        True if queue command is removed from sender successfully, else false.