From 88357a261b207d873663d7aabdc68d6523fb6416 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 6 Feb 2015 15:04:44 +1100 Subject: [PATCH] fixes #131 --- .../intellectualcrafters/plot/PlotMain.java | 1 - .../plot/generator/HybridPlotManager.java | 2 -- .../plot/listeners/PlayerEvents.java | 27 ++++++++++--------- .../plot/object/PlotManager.java | 3 +-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index 24a252aad..a8d29d694 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -1072,7 +1072,6 @@ public class PlotMain extends JavaPlugin implements Listener { FlagManager.addFlag(new AbstractFlag("place", new FlagValue.PlotBlockListValue())); FlagManager.addFlag(new AbstractFlag("break", new FlagValue.PlotBlockListValue())); FlagManager.addFlag(new AbstractFlag("use", new FlagValue.PlotBlockListValue())); - FlagManager.addFlag(new AbstractFlag("gamemode") { @Override diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index 41799e5cd..ed7125d2c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -75,11 +75,9 @@ import com.intellectualcrafters.plot.util.SendChunk; Location top = PlotHelper.getPlotTopLoc(world, plot.id); int botx = bottom.getBlockX(); - int boty = bottom.getBlockY(); int botz = bottom.getBlockZ(); int topx = top.getBlockX(); - int topy = top.getBlockY(); int topz = top.getBlockZ(); HybridPlotWorld hpw = (HybridPlotWorld) PlotMain.getWorldSettings(world); 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 f607b6197..072cbfe0b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -518,25 +518,26 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public static void MobSpawn(final CreatureSpawnEvent event) { + System.out.print(1); final World world = event.getLocation().getWorld(); + if (event.getEntity() instanceof Player) { + return; + } if (!isPlotWorld(world)) { return; } + Location loc = event.getLocation(); + if (!isPlotArea(loc)) { + return; + } final PlotWorld pW = getPlotWorld(world); final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason(); - if ((reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) { - return; - } else if ((reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) { - return; - } else if ((reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) { - return; - } - if (event.getEntity() instanceof Player) { - return; - } - Location loc = event.getLocation(); - if (!isInPlot(loc)) { - if (isPlotArea(loc)) { event.setCancelled(true); } + if (!(reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) { + event.setCancelled(true); + } else if (!(reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) { + event.setCancelled(true); + } else if (!(reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) { + event.setCancelled(true); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java index 40c72764d..3bc2f4298 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotManager.java @@ -27,7 +27,7 @@ import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Biome; -@SuppressWarnings("unused") public abstract class PlotManager { +public abstract class PlotManager { /* * Plot locations (methods with Abs in them will not need to consider mega @@ -49,7 +49,6 @@ import org.bukkit.block.Biome; /* * Plot clearing (return false if you do not support some method) */ - public abstract boolean clearPlot(final World world, final Plot plot, boolean isDelete); public abstract Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot);