From 3aa7a74626ca8a48faf1d4b5bb48136598b7f278 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Wed, 10 Jun 2015 06:00:53 +1000 Subject: [PATCH] Fix refresh chunk for 1.7.X --- PlotSquared/pom.xml | 2 +- .../com/intellectualcrafters/plot/BukkitMain.java | 12 ++++++------ .../com/intellectualcrafters/plot/PlotSquared.java | 5 ----- .../plot/util/bukkit/BukkitSetupUtils.java | 6 ------ .../plot/util/bukkit/SetBlockFast.java | 5 +++-- .../plot/util/bukkit/SetBlockFast_1_8.java | 4 ++-- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/PlotSquared/pom.xml b/PlotSquared/pom.xml index c5daac02e..dcbddd75d 100644 --- a/PlotSquared/pom.xml +++ b/PlotSquared/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 2.11.17 + 2.11.18 PlotSquared jar diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java index 5d67fe1e5..bfb93649f 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java @@ -438,6 +438,12 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain { e.printStackTrace(); BukkitSetBlockManager.setBlockManager = new SetBlockSlow(); } + try { + new SendChunk(); + MainUtil.canSendChunk = true; + } catch (final Throwable e) { + MainUtil.canSendChunk = false; + } } else { try { BukkitSetBlockManager.setBlockManager = new SetBlockFast(); @@ -447,12 +453,6 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain { } } BlockUpdateUtil.setBlockManager = BukkitSetBlockManager.setBlockManager; - try { - new SendChunk(); - MainUtil.canSendChunk = true; - } catch (final Throwable e) { - MainUtil.canSendChunk = false; - } return BlockManager.manager = new BukkitUtil(); } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 1aa501ea0..706501f20 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -373,11 +373,6 @@ public class PlotSquared { if (!config.contains(path)) { config.createSection(path); } - - System.out.print("GENERATOR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - System.out.print(generator != null); - System.out.print(generator instanceof PlotGenerator); - plotWorld.TYPE = generator instanceof PlotGenerator ? 0 : 2; plotWorld.TERRAIN = 0; plotWorld.saveConfiguration(config.getConfigurationSection(path)); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitSetupUtils.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitSetupUtils.java index 941dbe72b..bcced4434 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitSetupUtils.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/BukkitSetupUtils.java @@ -26,17 +26,11 @@ public class BukkitSetupUtils extends SetupUtils { } final String testWorld = "CheckingPlotSquaredGenerator"; for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) { - System.out.print(plugin.getName()); if (plugin.isEnabled()) { - System.out.print(" - enabled"); final ChunkGenerator generator = plugin.getDefaultWorldGenerator(testWorld, ""); if (generator != null) { - System.out.print(" - non null"); PlotSquared.removePlotWorld(testWorld); final String name = plugin.getDescription().getName(); - if (generator instanceof PlotGenerator) { - System.out.print(" - ps gen"); - } // final PlotGenerator pgen = (PlotGenerator) generator; // if (pgen.getPlotManager() instanceof SquarePlotManager) { SetupUtils.generators.put(name, generator); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast.java index b8100ab22..f9a7fd52e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast.java @@ -121,8 +121,9 @@ public class SetBlockFast extends BukkitSetBlockManager { } if (!MainUtil.canSendChunk) { for (Chunk chunk : chunks) { - chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ()); - chunk.load(true); + chunk.unload(true, false); +// chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ()); + chunk.load(); } return; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast_1_8.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast_1_8.java index 9c0c90744..1cca2f4fc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast_1_8.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/SetBlockFast_1_8.java @@ -333,8 +333,8 @@ public class SetBlockFast_1_8 extends BukkitSetBlockManager { } if (!MainUtil.canSendChunk) { for (Chunk chunk : chunks) { - chunk.getWorld().refreshChunk(chunk.getX(), chunk.getZ()); - chunk.load(true); + chunk.unload(true, false); + chunk.load(); } return; }