From 91c742c14122b526b0638388679e4e603178f38c Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 18 Jun 2016 13:13:36 +1000 Subject: [PATCH] Fixes #590 --- .../java/com/plotsquared/bukkit/listeners/PlayerEvents.java | 4 ++++ .../src/main/java/com/intellectualcrafters/plot/config/C.java | 4 ++++ .../intellectualcrafters/plot/util/block/LocalBlockQueue.java | 2 +- .../plot/util/block/ScopedLocalBlockQueue.java | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index 9fbc6f7bf..ec553699a 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -1318,6 +1318,10 @@ public class PlayerEvents extends PlotListener implements Listener { return; } if (checkEntity(entity, plot)) { + PlotPlayer owner = UUIDHandler.getPlayer(plot.owner); + if (owner != null) { + C.ENTITY_CAP.send(owner); + } event.setCancelled(true); } } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java index baa45a904..afde41add 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -316,6 +316,10 @@ public enum C { POSITION_UNSET("$1Home position reset to the default location", "Position"), HOME_ARGUMENT("$2Use /plot set home [none]", "Position"), INVALID_POSITION("$2That is not a valid position value", "Position"), + /* + * Cap + */ + ENTITY_CAP("$2You are not allowed to spawn more mobs", "cap"), /* * Time */ diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/intellectualcrafters/plot/util/block/LocalBlockQueue.java index 96fd8811f..ff02a4279 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/block/LocalBlockQueue.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/block/LocalBlockQueue.java @@ -21,7 +21,7 @@ public abstract class LocalBlockQueue { public ScopedLocalBlockQueue getForChunk(int x, int z) { int bx = x << 4; int bz = z << 4; - ScopedLocalBlockQueue scoped = new ScopedLocalBlockQueue(this, new Location(getWorld(), bx, 0, bz), new Location(getWorld(), bx + 15, 255, bz + 15)); + return new ScopedLocalBlockQueue(this, new Location(getWorld(), bx, 0, bz), new Location(getWorld(), bx + 15, 255, bz + 15)); } public abstract boolean next(); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/block/ScopedLocalBlockQueue.java b/Core/src/main/java/com/intellectualcrafters/plot/util/block/ScopedLocalBlockQueue.java index 745e810cb..e2d35a470 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/block/ScopedLocalBlockQueue.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/block/ScopedLocalBlockQueue.java @@ -42,8 +42,8 @@ public class ScopedLocalBlockQueue extends DelegateLocalBlockQueue { } public void fillBiome(String biome) { - for (int x = minX; x <= maxX; x++) { - for (int z = minZ; z < maxZ; z++) { + for (int x = 0; x <= dx; x++) { + for (int z = 0; z < dz; z++) { setBiome(x, z, biome); } }