diff --git a/PlotSquared/src/com/intellectualcrafters/plot/Plot.java b/PlotSquared/src/com/intellectualcrafters/plot/Plot.java index 47d064cb6..3e5825735 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/Plot.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/Plot.java @@ -219,9 +219,7 @@ public class Plot implements Cloneable { * @param uuid */ public void addDenied(UUID uuid) { - if (!denied.contains(uuid)) { - this.denied.add(uuid); - } + this.denied.add(uuid); } /** @@ -230,9 +228,7 @@ public class Plot implements Cloneable { * @param uuid */ public void addHelper(UUID uuid) { - if (!helpers.contains(uuid)) { - this.helpers.add(uuid); - } + this.helpers.add(uuid); } /** @@ -241,9 +237,7 @@ public class Plot implements Cloneable { * @param uuid */ public void addTrusted(UUID uuid) { - if (!trusted.contains(uuid)) { - this.trusted.add(uuid); - } + this.trusted.add(uuid); } /** diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Denied.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Denied.java index d51c72109..4563e5ded 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Denied.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Denied.java @@ -48,8 +48,12 @@ public class Denied extends SubCommand { if (args[0].equalsIgnoreCase("add")) { if (args[1].equalsIgnoreCase("*")) { UUID uuid = DBFunc.everyone; - plot.addDenied(uuid); - DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + if (!plot.denied.contains(uuid)) { + plot.addDenied(uuid); + DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.DENIED_ADDED); return true; } @@ -63,10 +67,12 @@ public class Denied extends SubCommand { * C.PLAYER_HAS_NOT_BEEN_ON); return true; } */ UUID uuid = UUIDHandler.getUUID(args[1]); - plot.addDenied(uuid); - DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); - PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true); - Bukkit.getPluginManager().callEvent(event); + if (!plot.denied.contains(uuid)) { + plot.addDenied(uuid); + DBFunc.setDenied(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotDeniedEvent event = new PlayerPlotDeniedEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.DENIED_ADDED); if ((Bukkit.getPlayer(uuid) != null) && Bukkit.getPlayer(uuid).isOnline()) { Plot pl = PlayerFunctions.getCurrentPlot(Bukkit.getPlayer((uuid))); diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Helpers.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Helpers.java index 49a0d263a..3ca326959 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Helpers.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Helpers.java @@ -45,8 +45,12 @@ public class Helpers extends SubCommand { if (args[0].equalsIgnoreCase("add")) { if (args[1].equalsIgnoreCase("*")) { UUID uuid = DBFunc.everyone; - plot.addHelper(uuid); - DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + if (!plot.helpers.contains(uuid)) { + plot.addHelper(uuid); + DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.HELPER_ADDED); return true; } @@ -60,10 +64,12 @@ public class Helpers extends SubCommand { * C.PLAYER_HAS_NOT_BEEN_ON); return true; } */ UUID uuid = UUIDHandler.getUUID(args[1]); - plot.addHelper(uuid); - DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); - PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true); - Bukkit.getPluginManager().callEvent(event); + if (!plot.helpers.contains(uuid)) { + plot.addHelper(uuid); + DBFunc.setHelper(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotHelperEvent event = new PlayerPlotHelperEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.HELPER_ADDED); } else diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Trusted.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Trusted.java index e78b22e94..562dfae73 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Trusted.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Trusted.java @@ -45,8 +45,12 @@ public class Trusted extends SubCommand { if (args[0].equalsIgnoreCase("add")) { if (args[1].equalsIgnoreCase("*")) { UUID uuid = DBFunc.everyone; - plot.addTrusted(uuid); - DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + if (!plot.trusted.contains(uuid)) { + plot.addTrusted(uuid); + DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED); return true; } @@ -60,10 +64,12 @@ public class Trusted extends SubCommand { * C.PLAYER_HAS_NOT_BEEN_ON); return true; } */ UUID uuid = UUIDHandler.getUUID(args[1]); - plot.addTrusted(uuid); - DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); - PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true); - Bukkit.getPluginManager().callEvent(event); + if (!plot.trusted.contains(uuid)) { + plot.addTrusted(uuid); + DBFunc.setTrusted(plr.getWorld().getName(), plot, Bukkit.getOfflinePlayer(args[1])); + PlayerPlotTrustedEvent event = new PlayerPlotTrustedEvent(plr, plot, uuid, true); + Bukkit.getPluginManager().callEvent(event); + } PlayerFunctions.sendMessage(plr, C.TRUSTED_ADDED); } else