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
master
Joey Hines 2018-10-23 17:35:06 -05:00
parent 8997133923
commit efb8545e56
1 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,8 @@ public class CommandPreprocessListener implements Listener {
hasReadRules.add(sender.getUniqueId().toString()); hasReadRules.add(sender.getUniqueId().toString());
} }
else if ("apply".equalsIgnoreCase(base)) { 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!")); sender.spigot().sendMessage(new TextComponent(ChatColor.RED + "Make sure to check /rules before applying!"));
} }
} }