From 6c96f4e974f4217114b16576839475d337bd8cc4 Mon Sep 17 00:00:00 2001 From: benwoo1110 <30431861+benwoo1110@users.noreply.github.com> Date: Wed, 28 Apr 2021 13:58:43 +0800 Subject: [PATCH 1/3] Ensure DummyCommandBlockSender isnt used for Op. --- .../commandtools/queue/DummyCommandBlockSender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java index 819602b6..7ec3dfe0 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/DummyCommandBlockSender.java @@ -94,7 +94,7 @@ class DummyCommandBlockSender implements CommandSender { @Override public boolean isOp() { - return true; + throw new UnsupportedOperationException(); } @Override From d95ecfaa8ed87e6f9148d7e3c3c4a52a90be46ca Mon Sep 17 00:00:00 2001 From: benwoo1110 <30431861+benwoo1110@users.noreply.github.com> Date: Wed, 28 Apr 2021 14:01:30 +0800 Subject: [PATCH 2/3] Update some CommandQueueManager docs to be clearer. --- .../commandtools/queue/CommandQueueManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java index a5c808e0..802aebb1 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java @@ -21,7 +21,10 @@ import java.util.Map; import java.util.WeakHashMap; /** - * Managers the queuing of dangerous commands that needs to use '/mv confirm' before executing. + *

Manager's the queuing of dangerous commands that requires '/mv confirm' before executing.

+ * + *

Each sender can only have one command in queue at any given time. When queue command is added + * for a sender that already has a command in queue, it will replace the old queue command.

*/ public class CommandQueueManager { @@ -37,7 +40,7 @@ public class CommandQueueManager { } /** - * Adds a queue command into queue. + * Adds a {@link QueuedCommand} into queue. * * @param queuedCommand The queue command to add. */ From 141854f076c0082c9a7aaf1160a339428a53b6c4 Mon Sep 17 00:00:00 2001 From: Kermina Awad Date: Sun, 16 May 2021 11:21:20 -0400 Subject: [PATCH 3/3] correct some javadoc typos --- .../commandtools/queue/CommandQueueManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java index 802aebb1..8f6a3023 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commandtools/queue/CommandQueueManager.java @@ -21,10 +21,10 @@ import java.util.Map; import java.util.WeakHashMap; /** - *

Manager's the queuing of dangerous commands that requires '/mv confirm' before executing.

+ *

Manages the queuing of dangerous commands that require {@code /mv confirm} before executing.

* - *

Each sender can only have one command in queue at any given time. When queue command is added - * for a sender that already has a command in queue, it will replace the old queue command.

+ *

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.

*/ public class CommandQueueManager { @@ -42,7 +42,7 @@ public class CommandQueueManager { /** * Adds a {@link QueuedCommand} into queue. * - * @param queuedCommand The queue command to add. + * @param queuedCommand The queued command to add. */ public void addToQueue(QueuedCommand queuedCommand) { CommandSender targetSender = parseSender(queuedCommand.getSender()); @@ -60,7 +60,7 @@ public class CommandQueueManager { } /** - * Expire task that remove {@link QueuedCommand} from queue after valid duration defined. + * Expire task that removes a {@link QueuedCommand} from queue after valid duration defined. * * @param queuedCommand Command to run the expire task on. * @return The expire {@link BukkitTask}. @@ -133,7 +133,7 @@ public class CommandQueueManager { /** * To allow all CommandBlocks to be a common sender with use of {@link DummyCommandBlockSender}. - * So confirm command can be used for a queue command on another command block. + * So confirm command can be used for a queued command on another command block. * * @param sender The sender to parse. * @return The sender, or if its a command block, a {@link DummyCommandBlockSender}. @@ -149,9 +149,9 @@ public class CommandQueueManager { } /** - * Check if sender is a command block. + * Checks if the sender is a command block. * - * @param sender The sender to check on. + * @param sender The sender to check. * @return True if sender is a command block, else false. */ private boolean isCommandBlock(@NotNull CommandSender sender) {