From efb8545e56018b528f534d8c46fe9b20a22315c9 Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Tue, 23 Oct 2018 17:35:06 -0500 Subject: [PATCH] Made changes according to the comments in PR #9 /apply is now cancelled if the user didn't read the rules User is now not removed from the hasReadRules list until restart --- .../minecraftmanager/listeners/CommandPreprocessListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/xyz/etztech/minecraftmanager/listeners/CommandPreprocessListener.java b/src/main/java/xyz/etztech/minecraftmanager/listeners/CommandPreprocessListener.java index df40975..736d6bc 100644 --- a/src/main/java/xyz/etztech/minecraftmanager/listeners/CommandPreprocessListener.java +++ b/src/main/java/xyz/etztech/minecraftmanager/listeners/CommandPreprocessListener.java @@ -79,7 +79,8 @@ public class CommandPreprocessListener implements Listener { hasReadRules.add(sender.getUniqueId().toString()); } else if ("apply".equalsIgnoreCase(base)) { - if(!hasReadRules.remove(sender.getUniqueId().toString())) { + if(!hasReadRules.contains(sender.getUniqueId().toString())) { + event.setCancelled(true); sender.spigot().sendMessage(new TextComponent(ChatColor.RED + "Make sure to check /rules before applying!")); } }