From f1a7e0d73f741374f0b75c87a613a66357e7c558 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 3 May 2015 13:51:48 +1000 Subject: [PATCH] Fixes #293 --- PlotSquared/pom.xml | 2 +- .../plot/commands/BukkitCommand.java | 1 - .../plot/generator/AugmentedPopulator.java | 36 +++++++++++++------ .../plot/listeners/PlayerEvents.java | 2 -- .../plot/util/bukkit/UUIDHandler.java | 4 --- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/PlotSquared/pom.xml b/PlotSquared/pom.xml index ff14f40fa..b5d2ed70b 100644 --- a/PlotSquared/pom.xml +++ b/PlotSquared/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 2.10.1 + 2.10.2 PlotSquared jar diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/BukkitCommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/BukkitCommand.java index 4aea2ba5b..b391de92c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/BukkitCommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/BukkitCommand.java @@ -53,7 +53,6 @@ public class BukkitCommand implements CommandExecutor, TabCompleter { } String best = new StringComparison(strings[0], commands).getBestMatch(); tabOptions.add(best); - System.out.print("TAB OPTIONS"); final String arg = strings[0].toLowerCase(); for (final SubCommand cmd : MainCommand.subCommands) { if (!cmd.cmd.equalsIgnoreCase(best)) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java index dba2d9553..72b4fdc06 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java @@ -202,16 +202,7 @@ public class AugmentedPopulator extends BlockPopulator { } } if (this.o) { - chunk.load(true); populateBlocks(world, rand, X, Z, x, z, check); - TaskManager.runTaskLater(new Runnable() { - @Override - public void run() { - // Don't need to populate biome with this -// populateBiome(world, x, z); - MainUtil.update(world.getName(), new ChunkLoc(chunk.getX(), chunk.getZ())); - } - }, 20); } else { TaskManager.runTaskLater(new Runnable() { @Override @@ -224,7 +215,6 @@ public class AugmentedPopulator extends BlockPopulator { public void run() { chunk.load(true); populateBlocks(world, rand, X, Z, x, z, check); - MainUtil.update(world.getName(), new ChunkLoc(chunk.getX(), chunk.getZ())); } }, 40 + rand.nextInt(40)); } @@ -252,7 +242,7 @@ public class AugmentedPopulator extends BlockPopulator { short id = result[i][j]; final int xx = x + x1; final int zz = z + z1; - if (check && (((z + z1) < this.bz) || ((z + z1) > this.tz) || ((x + x1) < this.bx) || ((x + x1) > this.tx))) { + if (check && (((zz) < this.bz) || ((zz) > this.tz) || ((xx) < this.bx) || ((xx) > this.tx))) { continue; } if (this.p) { @@ -267,6 +257,30 @@ public class AugmentedPopulator extends BlockPopulator { BukkitSetBlockManager.setBlockManager.set(world, xx, y, zz, id, (byte) 0); } } + else { + short y_min = y_loc[i][0]; + if (y_min < 128) { + for (int x1 = x; x1 < x + 16; x1++) { + for (int z1 = z; z1 < z + 16; z1++) { + if (check && (((z1) < this.bz) || ((z1) > this.tz) || ((x1) < this.bx) || ((x1) > this.tx))) { + continue; + } + if (this.p) { + if (ChunkManager.CURRENT_PLOT_CLEAR != null) { + if (BukkitChunkManager.isIn(ChunkManager.CURRENT_PLOT_CLEAR, x1, z1)) { + continue; + } + } else if (this.manager.getPlotIdAbs(this.plotworld, x1, 0, z1) != null) { + continue; + } + } + for (int y = y_min; y < y_min + 16; y++) { + BukkitSetBlockManager.setBlockManager.set(world, x1, y, z1, 0, (byte) 0); + } + } + } + } + } } for (final BlockPopulator populator : this.generator.getDefaultPopulators(world)) { Chunk chunk = world.getChunkAt(X, Z); 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 1669057c7..815e914c5 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -830,12 +830,10 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi } final PlotWorld pW = PlotSquared.getPlotWorld(world); final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason(); - System.out.print("REASON: " + reason); if ((reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG || reason == CreatureSpawnEvent.SpawnReason.DISPENSE_EGG) && !pW.SPAWN_EGGS) { event.setCancelled(true); return; } else if ((reason == CreatureSpawnEvent.SpawnReason.BREEDING) && !pW.SPAWN_BREEDING) { - System.out.print("CANCELLED: " + pW.SPAWN_BREEDING); event.setCancelled(true); return; } else if ((reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && !pW.SPAWN_CUSTOM && !(event.getEntityType().getTypeId() == 30)) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java index 47496872f..a07bb44f4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/UUIDHandler.java @@ -138,8 +138,6 @@ public class UUIDHandler { } } PlotSquared.log(C.PREFIX.s() + "&6Cached a total of: " + UUIDHandler.uuidMap.size() + " UUIDs"); - System.out.print(System.currentTimeMillis() - start); - System.out.print(Settings.TWIN_MODE_UUID); return; } @@ -213,8 +211,6 @@ public class UUIDHandler { // add the Everyone '*' UUID add(new StringWrapper("*"), DBFunc.everyone); PlotSquared.log(C.PREFIX.s() + "&6Cached a total of: " + UUIDHandler.uuidMap.size() + " UUIDs"); - System.out.print(System.currentTimeMillis() - start); - System.out.print(Settings.TWIN_MODE_UUID); } public static UUID getUUID(final PlotPlayer player) {