Fix 1.8 packet sending

This commit is contained in:
Jesse Boyd 2016-05-02 16:44:30 +10:00
parent 7d9043da51
commit 71da20c6c4
4 changed files with 5 additions and 14 deletions

View File

@ -190,11 +190,11 @@ public abstract class BukkitQueue_0<CHUNK, CHUNKSECTIONS, SECTION> extends NMSMa
}
@Override
public FaweChunk getChunk(final int x, final int z) {
public FaweChunk getChunk(int x, int z) {
return new CharFaweChunk<Chunk>(this, x, z) {
@Override
public Chunk getNewChunk() {
return getWorld().getChunkAt(x, z);
return BukkitQueue_0.this.getWorld().getChunkAt(getX(), getZ());
}
};
}

View File

@ -133,16 +133,13 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
continue;
}
char[] currentArray = section.getIdArray();
boolean fill = true;
int solid = 0;
for (int k = 0; k < newArray.length; k++) {
char n = newArray[k];
switch (n) {
case 0:
fill = false;
continue;
case 1:
fill = false;
if (currentArray[k] > 1) {
solid++;
}
@ -155,9 +152,6 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
}
}
setCount(0, solid, section);
if (fill) {
fs.setCount(j, Short.MAX_VALUE);
}
}
// // Clear
} catch (Throwable e) {
@ -205,7 +199,7 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], char[]
int view = Bukkit.getViewDistance();
for (FawePlayer fp : Fawe.get().getCachedPlayers()) {
BukkitPlayer bukkitPlayer = (BukkitPlayer) fp;
if (!bukkitPlayer.getWorld().equals(world)) {
if (!bukkitPlayer.parent.getWorld().equals(world)) {
continue;
}
net.minecraft.server.v1_8_R3.EntityPlayer nmsPlayer = ((CraftPlayer) bukkitPlayer.parent).getHandle();

View File

@ -11,7 +11,6 @@ import net.minecraft.server.v1_9_R1.DataPalette;
import net.minecraft.server.v1_9_R1.DataPaletteBlock;
import net.minecraft.server.v1_9_R1.DataPaletteGlobal;
import net.minecraft.server.v1_9_R1.IBlockData;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
public class BukkitChunk_1_9 extends CharFaweChunk<Chunk> {
@ -31,7 +30,7 @@ public class BukkitChunk_1_9 extends CharFaweChunk<Chunk> {
@Override
public Chunk getNewChunk() {
return Bukkit.getWorld(getParent().world).getChunkAt(getX(), getZ());
return ((BukkitQueue_1_9_R1) getParent()).getWorld().getChunkAt(getX(), getZ());
}
@Override

View File

@ -57,9 +57,7 @@ public class SpongeQueue_1_8 extends NMSMappedFaweQueue<World, net.minecraft.wor
}
NetHandlerPlayServer con = nmsPlayer.playerNetServerHandler;
net.minecraft.world.chunk.Chunk nmsChunk = (net.minecraft.world.chunk.Chunk) chunk;
con.sendPacket(new S21PacketChunkData(nmsChunk, false, 65535));
// Try sending true, 0 first
// Try bulk chunk packet
con.sendPacket(new S21PacketChunkData(chunk, false, 65535));
}
}