From 1db3d1aa72e38a01b490f4a938d964874f4191ac Mon Sep 17 00:00:00 2001 From: MattBDev Date: Wed, 11 May 2016 11:16:38 -0400 Subject: [PATCH 1/2] Start 3.3.4 work to support 1.9.4 --- Bukkit/build.gradle | 2 +- .../java/com/plotsquared/bukkit/util/SendChunk.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index 21876b376..b4b34c951 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -1,6 +1,6 @@ dependencies { compile project(':Core') - compile 'org.bukkit:bukkit:1.9-R0.1-SNAPSHOT' + compile 'org.bukkit:bukkit:1.9.2-R0.1-SNAPSHOT' compile 'org.mcstats.bukkit:metrics:R7' compile 'net.milkbowl.vault:VaultAPI:1.5' } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java index 840b149cd..21ff09240 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java @@ -50,7 +50,11 @@ public class SendChunk { RefClass classChunk = getRefClass("{nms}.Chunk"); this.methodInitLighting = classChunk.getMethod("initLighting"); RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk"); - this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); + if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) { + this.mapChunk = null; //todo + } else { + this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); + } RefClass classEntityPlayer = getRefClass("{nms}.EntityPlayer"); this.connection = classEntityPlayer.getField("playerConnection"); RefClass classPacket = getRefClass("{nms}.Packet"); @@ -105,7 +109,12 @@ public class SendChunk { Object c = this.methodGetHandleChunk.of(chunk).call(); chunks.remove(chunk); Object con = this.connection.of(entity).get(); - Object packet = this.mapChunk.create(c, true, 65535); + Object packet; + if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) { + packet = null; //todo + } else { + packet = this.mapChunk.create(c, true, 65535); + } this.send.of(con).call(packet); } } From d5cf81be5ced28cd041e38a9b5a3e71eb890895e Mon Sep 17 00:00:00 2001 From: MattBDev Date: Wed, 11 May 2016 12:11:46 -0400 Subject: [PATCH 2/2] 1.9.4 compatibility. --- .../src/main/java/com/plotsquared/bukkit/util/SendChunk.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java index 21ff09240..35e9d7f62 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java @@ -51,7 +51,7 @@ public class SendChunk { this.methodInitLighting = classChunk.getMethod("initLighting"); RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk"); if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) { - this.mapChunk = null; //todo + this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(),int.class); } else { this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class); } @@ -111,7 +111,7 @@ public class SendChunk { Object con = this.connection.of(entity).get(); Object packet; if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) { - packet = null; //todo + packet = this.mapChunk.create(c,65535); } else { packet = this.mapChunk.create(c, true, 65535); }