From c16a6c85e01508fb0c7d4a1f87d77f5f85b7e8e5 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 30 Jan 2015 11:25:08 +1100 Subject: [PATCH] Hanging and vehicle destroy --- .../intellectualcrafters/plot/PlotMain.java | 5 +- .../plot/commands/SetOwner.java | 2 +- .../plot/listeners/ForceFieldListener.java | 4 - .../plot/listeners/PlayerEvents.java | 156 ++++++++++++++---- .../plot/listeners/WorldGuardListener.java | 1 - 5 files changed, 126 insertions(+), 42 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index c0752b704..f3551b5c6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1352,9 +1352,6 @@ public class PlotMain extends JavaPlugin implements Listener { plotCommand.setAliases(Arrays.asList("p", "ps", "plotme", "plot")); plotCommand.setTabCompleter(command); } -// if (Settings.MOB_CAP_ENABLED) { -// getServer().getPluginManager().registerEvents(new EntityListener(), this); -// } // Main event handler getServer().getPluginManager().registerEvents(new PlayerEvents(), this); @@ -1367,7 +1364,7 @@ public class PlotMain extends JavaPlugin implements Listener { // Flag+ listener getServer().getPluginManager().registerEvents(new PlotPlusListener(), this); // Forcefield listener - getServer().getPluginManager().registerEvents(new ForceFieldListener(this), this); + getServer().getPluginManager().registerEvents(new ForceFieldListener(), this); // Default flags if (getServer().getPluginManager().getPlugin("BarAPI") != null) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java index c27df004e..e1ded1f0c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/SetOwner.java @@ -64,7 +64,7 @@ public class SetOwner extends SubCommand { return false; } - if (!plot.owner.equals(UUIDHandler.getUUID(plr))) { + if (!plot.owner.equals(UUIDHandler.getUUID(plr)) && !PlotMain.hasPermission(plr, "plots.admin.command.setowner")) { PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.admin.command.setowner"); return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/ForceFieldListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/ForceFieldListener.java index 4baed4e9a..cedd0192d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/ForceFieldListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/ForceFieldListener.java @@ -42,10 +42,6 @@ import com.intellectualcrafters.plot.util.PlayerFunctions; */ public class ForceFieldListener implements Listener { - public ForceFieldListener(final JavaPlugin plugin) { - plugin.getServer().getPluginManager().registerEvents(this, plugin); - } - private Set getNearbyPlayers(final Player player, final Plot plot) { final Set players = new HashSet<>(); Player oPlayer; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 2661d2278..bb16cc3d3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -75,6 +75,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.vehicle.VehicleDestroyEvent; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.WorldLoadEvent; @@ -191,6 +192,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (!plot.equals(getCurrentPlot(f))) { if (plot.deny_entry(player)) { if (!PlotMain.hasPermission(player, "plots.admin.entry.denied")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.entry.denied"); event.setCancelled(true); return; } @@ -243,6 +245,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (!isPlotWorld(world)) { return; } + Player player = event.getPlayer(); if (isInPlot(event.getBlock().getLocation())) { if (event.getBlock().getY() == 0) { event.setCancelled(true); @@ -250,7 +253,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } final Plot plot = getCurrentPlot(event.getBlock().getLocation()); if (!plot.hasOwner()) { - if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.unowned")) { + if (PlotMain.hasPermission(player, "plots.admin.destroy.unowned")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.unowned"); return; } event.setCancelled(true); @@ -262,6 +266,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.other")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.other"); return; } event.setCancelled(true); @@ -269,6 +274,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.road"); return; } event.setCancelled(true); @@ -312,16 +318,19 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player p = (Player) e; if (!isInPlot(b.getLocation())) { if (!PlotMain.hasPermission(p, "plots.admin.build.road")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road"); event.setCancelled(true); } } else { final Plot plot = getCurrentPlot(b.getLocation()); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.build.unowned")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned"); event.setCancelled(true); } } else if (!plot.hasRights(p)) { if (!PlotMain.hasPermission(p, "plots.admin.build.other")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other"); event.setCancelled(true); } } @@ -496,6 +505,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Plot plot = getCurrentPlot(event.getClickedBlock().getLocation()); if (!plot.hasOwner()) { if (PlotMain.hasPermission(player, "plots.admin.interact.unowned")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.interact.unowned"); return; } } @@ -503,8 +513,9 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (use != null && ((HashSet) use.getValue()).contains(new PlotBlock((short) block.getTypeId(), block.getData()))) { return; } - if (!plot.hasRights(event.getPlayer())) { + if (!plot.hasRights(player)) { if (PlotMain.hasPermission(player, "plots.admin.interact.other")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.interact.other"); return; } event.setCancelled(true); @@ -512,6 +523,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (PlotMain.hasPermission(player, "plots.admin.interact.road")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.interact.road"); return; } event.setCancelled(true); @@ -567,16 +579,19 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player p = e.getPlayer(); if (!isInPlot(b.getLocation())) { if (!PlotMain.hasPermission(p, "plots.admin.build.road")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road"); e.setCancelled(true); } } else { final Plot plot = getCurrentPlot(b.getLocation()); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.build.unowned")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned"); e.setCancelled(true); } } else if (!plot.hasRights(p)) { if (!PlotMain.hasPermission(p, "plots.admin.build.other")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other"); e.setCancelled(true); } } @@ -621,29 +636,30 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final BlockFace bf = e.getBlockFace(); final Block b = e.getBlockClicked().getLocation().add(bf.getModX(), bf.getModY(), bf.getModZ()).getBlock(); if (isPlotWorld(b.getLocation())) { + Player p = e.getPlayer(); if (!isInPlot(b.getLocation())) { - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.road")) { + if (PlotMain.hasPermission(p, "plots.admin.build.road")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road"); e.setCancelled(true); } else { final Plot plot = getCurrentPlot(b.getLocation()); if (plot == null || !plot.hasOwner()) { - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.unowned")) { + if (PlotMain.hasPermission(p, "plots.admin.build.unowned")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned"); e.setCancelled(true); } else if (!plot.hasRights(e.getPlayer())) { Flag use = FlagManager.getPlotFlag(plot, "use"); if (use != null && ((HashSet) use.getValue()).contains(new PlotBlock((short) e.getBucket().getId(), (byte) 0))) { return; } - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.other")) { + if (PlotMain.hasPermission(p, "plots.admin.build.other")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other"); e.setCancelled(true); } } @@ -680,19 +696,20 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi public static void onBucketFill(final PlayerBucketFillEvent e) { final Block b = e.getBlockClicked(); if (isPlotWorld(b.getLocation())) { + Player p = e.getPlayer(); if (!isInPlot(b.getLocation())) { - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.road")) { + if (PlotMain.hasPermission(p, "plots.admin.build.road")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road"); e.setCancelled(true); } else { final Plot plot = getCurrentPlot(b.getLocation()); if (plot == null || !plot.hasOwner()) { - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.unowned")) { + if (PlotMain.hasPermission(p, "plots.admin.build.unowned")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned"); e.setCancelled(true); } else if (!plot.hasRights(e.getPlayer())) { Flag use = FlagManager.getPlotFlag(plot, "use"); @@ -700,10 +717,10 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (use != null && ((HashSet) use.getValue()).contains(new PlotBlock((short) block.getTypeId(), block.getData()))) { return; } - if (PlotMain.hasPermission(e.getPlayer(), "plots.admin.build.other")) { + if (PlotMain.hasPermission(p, "plots.admin.build.other")) { return; } - PlayerFunctions.sendMessage(e.getPlayer(), C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other"); e.setCancelled(true); } } @@ -717,14 +734,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player p = e.getPlayer(); if (!isInPlot(b.getLocation())) { if (!PlotMain.hasPermission(p, "plots.admin.build.road")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.road"); e.setCancelled(true); } } else { final Plot plot = getCurrentPlot(b.getLocation()); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.build.unowned")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.unowned"); e.setCancelled(true); } } else if (!plot.hasRights(p)) { @@ -732,7 +749,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (!PlotMain.hasPermission(p, "plots.admin.build.other")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.build.other"); e.setCancelled(true); } } @@ -749,14 +766,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (isPlotWorld(l)) { if (!isInPlot(l)) { if (!PlotMain.hasPermission(p, "plots.admin.destroy.road")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.road"); e.setCancelled(true); } } else { final Plot plot = getCurrentPlot(l); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.destroy.unowned")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.unowned"); e.setCancelled(true); } } else if (!plot.hasRights(p)) { @@ -764,7 +781,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (!PlotMain.hasPermission(p, "plots.admin.destroy.other")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.other"); e.setCancelled(true); } } @@ -780,14 +797,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player p = e.getPlayer(); if (!isInPlot(l)) { if (!PlotMain.hasPermission(p, "plots.admin.interact.road")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.road"); e.setCancelled(true); } } else { final Plot plot = getCurrentPlot(l); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.interact.unowned")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.unowned"); e.setCancelled(true); } } else if (!plot.hasRights(p)) { @@ -805,7 +822,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (!PlotMain.hasPermission(p, "plots.admin.interact.other")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.interact.other"); e.setCancelled(true); } } @@ -813,6 +830,81 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } } + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) + public static void onVehicleDestroy (VehicleDestroyEvent e) { + final Location l = e.getVehicle().getLocation(); + if (isPlotWorld(l)) { + Entity d = e.getAttacker(); + if (d instanceof Player) { + final Player p = (Player) d; + final PlotWorld pW = getPlotWorld(l.getWorld()); + if (!isInPlot(l)) { + if (!PlotMain.hasPermission(p, "plots.admin.vehicle.break.road")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.road"); + e.setCancelled(true); + } + } else { + final Plot plot = getCurrentPlot(l); + if (plot == null || !plot.hasOwner()) { + if (!PlotMain.hasPermission(p, "plots.admin.vehicle.break.unowned")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.unowned"); + e.setCancelled(true); + return; + } + return; + } + if (!plot.hasRights(p)) { + if (FlagManager.isPlotFlagTrue(plot, "vehicle-break")) { + return; + } + if (!PlotMain.hasPermission(p, "plots.admin.vehicle.break.other")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.vehicle.break.other"); + e.setCancelled(true); + } + } + } + } + } + } + + @EventHandler + public void ArmorStandDestroy(EntityDamageByEntityEvent e){ + final Location l = e.getEntity().getLocation(); + if (isPlotWorld(l)) { + Entity d = e.getDamager(); + if (d instanceof Player) { + final Player p = (Player) d; + final PlotWorld pW = getPlotWorld(l.getWorld()); + if (!isInPlot(l)) { + if (!PlotMain.hasPermission(p, "plots.admin.destroy.road")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.road"); + e.setCancelled(true); + } + } else { + final Plot plot = getCurrentPlot(l); + if (plot == null || !plot.hasOwner()) { + if (!PlotMain.hasPermission(p, "plots.admin.destroy.unowned")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.unowned"); + e.setCancelled(true); + return; + } + return; + } + if (!plot.hasRights(p)) { + if (FlagManager.isPlotFlagTrue(plot, "hanging-break")) { + return; + } + if (!PlotMain.hasPermission(p, "plots.admin.destroy.other")) { + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.destroy.other"); + e.setCancelled(true); + } + } + } + } + } + } + + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public static void onEntityDamageByEntityEvent(final EntityDamageByEntityEvent e) { final Location l = e.getEntity().getLocation(); @@ -830,14 +922,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } if (!isInPlot(l)) { if (!PlotMain.hasPermission(p, "plots.admin.pve.road")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.road"); e.setCancelled(true); } } else { final Plot plot = getCurrentPlot(l); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.pve.unowned")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.unowned"); e.setCancelled(true); return; } @@ -849,9 +941,6 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } assert plot != null; if (!plot.hasRights(p)) { - if (a instanceof RideableMinecart && FlagManager.isPlotFlagTrue(plot, "vehicle-break")) { - return; - } if (a instanceof Monster && FlagManager.isPlotFlagTrue(plot, "hostile-attack")) { return; } @@ -862,7 +951,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (!PlotMain.hasPermission(p, "plots.admin.pve.other")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.pve.other"); e.setCancelled(true); } } @@ -878,19 +967,19 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi final Player p = e.getPlayer(); if (!isInPlot(l)) { if (!PlotMain.hasPermission(p, "plots.admin.projectile.road")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.road"); e.setHatching(false); } } else { final Plot plot = getCurrentPlot(l); if (plot == null || !plot.hasOwner()) { if (!PlotMain.hasPermission(p, "plots.admin.projectile.unowned")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.unowned"); e.setHatching(false); } } else if (!plot.hasRights(p)) { if (!PlotMain.hasPermission(p, "plots.admin.projectile.other")) { - PlayerFunctions.sendMessage(p, C.NO_PLOT_PERMS); + PlayerFunctions.sendMessage(p, C.NO_PERMISSION, "plots.admin.projectile.other"); e.setHatching(false); } } @@ -911,6 +1000,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (isInPlot(event.getBlock().getLocation())) { final Plot plot = getCurrentPlot(event.getBlockPlaced().getLocation()); if (!plot.hasOwner() && PlotMain.hasPermission(player, "plots.admin.build.unowned")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.unowned"); return; } if (!plot.hasRights(player)) { @@ -920,12 +1010,14 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi return; } if (!PlotMain.hasPermission(player, "plots.admin.build.other")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.other"); event.setCancelled(true); } } return; } if (!PlotMain.hasPermission(player, "plots.admin.build.road")) { + PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.build.road"); event.setCancelled(true); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldGuardListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldGuardListener.java index 8eb677bfa..5154a1182 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldGuardListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/WorldGuardListener.java @@ -63,7 +63,6 @@ public class WorldGuardListener implements Listener { public final ArrayList> flags; public WorldGuardListener(final PlotMain plugin) { - plugin.getServer().getPluginManager().registerEvents(this, plugin); this.str_flags = new ArrayList<>(); this.flags = new ArrayList<>(); for (final Flag flag : DefaultFlag.getFlags()) {