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>
</properties>
<artifactId>PlotSquared</artifactId>
<version>3.1.5</version>
<version>3.1.6</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -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 {

View File

@ -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()) {

View File

@ -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) {

Binary file not shown.

Binary file not shown.