This commit is contained in:
boy0001 2015-08-25 10:51:33 +10:00
parent ee17457403
commit 2b187f2066
6 changed files with 7 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>3.1.5</version> <version>3.1.6</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

@ -409,6 +409,7 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
new SendChunk(); new SendChunk();
MainUtil.canSendChunk = true; MainUtil.canSendChunk = true;
} catch (final Throwable e) { } catch (final Throwable e) {
e.printStackTrace();
MainUtil.canSendChunk = false; MainUtil.canSendChunk = false;
} }
} else { } else {

View File

@ -102,7 +102,7 @@ public class BukkitChunkManager extends ChunkManager {
World worldObj = Bukkit.getWorld(world); World worldObj = Bukkit.getWorld(world);
// Chunk chunk = worldObj.getChunkAt(loc.x, loc.z); // Chunk chunk = worldObj.getChunkAt(loc.x, loc.z);
worldObj.regenerateChunk(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)); BlockUpdateUtil.setBlockManager.update(world, Arrays.asList(loc));
} }
for (final Player player : worldObj.getPlayers()) { for (final Player player : worldObj.getPlayers()) {

View File

@ -48,6 +48,7 @@ public class SendChunk {
private RefConstructor MapChunk; private RefConstructor MapChunk;
private RefField connection; private RefField connection;
private RefMethod send; private RefMethod send;
private RefMethod methodInitLighting;
/** /**
* Constructor * Constructor
@ -57,6 +58,7 @@ public class SendChunk {
public SendChunk() throws NoSuchMethodException { public SendChunk() throws NoSuchMethodException {
methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle"); methodGetHandlePlayer = classCraftPlayer.getMethod("getHandle");
methodGetHandleChunk = classCraftChunk.getMethod("getHandle"); methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
methodInitLighting = classChunk.getMethod("initLighting");
MapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); MapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class);
connection = classEntityPlayer.getField("playerConnection"); connection = classEntityPlayer.getField("playerConnection");
send = classConnection.getMethod("sendPacket", classPacket.getRealClass()); send = classConnection.getMethod("sendPacket", classPacket.getRealClass());
@ -104,8 +106,8 @@ public class SendChunk {
if (dx > view || dz > view) { if (dx > view || dz > view) {
continue; continue;
} }
net.minecraft.server.v1_8_R2.Chunk c = (net.minecraft.server.v1_8_R2.Chunk) methodGetHandleChunk.of(chunk).call(); Object c = methodGetHandleChunk.of(chunk).call();
c.initLighting(); methodInitLighting.of(c).call();
chunks.remove(chunk); chunks.remove(chunk);
Object con = connection.of(entity).get(); Object con = connection.of(entity).get();
// if (dx != 0 || dz != 0) { // if (dx != 0 || dz != 0) {

Binary file not shown.

Binary file not shown.