mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge branch '3.3.4'
# Conflicts: # Bukkit/src/main/java/com/plotsquared/bukkit/util/SendChunk.java
This commit is contained in:
commit
63472ebeaf
@ -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.6'
|
||||
}
|
||||
|
@ -52,6 +52,11 @@ public class SendChunk {
|
||||
RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk");
|
||||
//TODO in 1.7.10 this is PacketPlayOutMapChunk(Chunk chunk, boolean flag, int i, int version)
|
||||
this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), boolean.class, int.class);
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) {
|
||||
this.mapChunk = classMapChunk.getConstructor(classChunk.getRealClass(),int.class);
|
||||
} 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");
|
||||
@ -106,7 +111,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 = this.mapChunk.create(c,65535);
|
||||
} else {
|
||||
packet = this.mapChunk.create(c, true, 65535);
|
||||
}
|
||||
this.send.of(con).call(packet);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user