diff --git a/pom.xml b/pom.xml index 5793cc69b..484169215 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 3.1.5 + 3.1.6 PlotSquared jar diff --git a/src/main/java/com/plotsquared/bukkit/BukkitMain.java b/src/main/java/com/plotsquared/bukkit/BukkitMain.java index c645e4cf8..ee2788363 100644 --- a/src/main/java/com/plotsquared/bukkit/BukkitMain.java +++ b/src/main/java/com/plotsquared/bukkit/BukkitMain.java @@ -409,6 +409,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain { new SendChunk(); MainUtil.canSendChunk = true; } catch (final Throwable e) { + e.printStackTrace(); MainUtil.canSendChunk = false; } } else { diff --git a/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java b/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java index 444dc2fae..4880e1f87 100644 --- a/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/src/main/java/com/plotsquared/bukkit/util/BukkitChunkManager.java @@ -102,7 +102,7 @@ public class BukkitChunkManager extends ChunkManager { World worldObj = Bukkit.getWorld(world); // Chunk chunk = worldObj.getChunkAt(loc.x, loc.z); worldObj.regenerateChunk(loc.x, loc.z); - if (MainUtil.canSendChunk && BlockUpdateUtil.setBlockManager != null) { + if (BlockUpdateUtil.setBlockManager != null) { BlockUpdateUtil.setBlockManager.update(world, Arrays.asList(loc)); } for (final Player player : worldObj.getPlayers()) { diff --git a/src/main/java/com/plotsquared/bukkit/util/SendChunk.java b/src/main/java/com/plotsquared/bukkit/util/SendChunk.java index 2e01b0371..0724ecbcf 100644 --- a/src/main/java/com/plotsquared/bukkit/util/SendChunk.java +++ b/src/main/java/com/plotsquared/bukkit/util/SendChunk.java @@ -48,6 +48,7 @@ public class SendChunk { private RefConstructor MapChunk; private RefField connection; private RefMethod send; + private RefMethod methodInitLighting; /** * Constructor @@ -57,6 +58,7 @@ public class SendChunk { public SendChunk() throws NoSuchMethodException { methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle"); methodGetHandleChunk = classCraftChunk.getMethod("getHandle"); + methodInitLighting = classChunk.getMethod("initLighting"); MapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); connection = classEntityPlayer.getField("playerConnection"); send = classConnection.getMethod("sendPacket", classPacket.getRealClass()); @@ -104,8 +106,8 @@ public class SendChunk { if (dx > view || dz > view) { continue; } - net.minecraft.server.v1_8_R2.Chunk c = (net.minecraft.server.v1_8_R2.Chunk) methodGetHandleChunk.of(chunk).call(); - c.initLighting(); + Object c = methodGetHandleChunk.of(chunk).call(); + methodInitLighting.of(c).call(); chunks.remove(chunk); Object con = connection.of(entity).get(); // if (dx != 0 || dz != 0) { diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 35a0a7c43..5405230fb 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index c860e4053..5f93da102 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ