Send the chunkbulk packets immediately. Fixes #535

This commit is contained in:
Matsv 2016-11-16 17:15:36 +01:00
parent 8e3b8cb572
commit df3be302af
2 changed files with 16 additions and 2 deletions

View File

@ -283,9 +283,23 @@ public class PacketWrapper {
* @throws Exception if it fails to write
*/
public void send(Class<? extends Protocol> packetProtocol, boolean skipCurrentPipeline) throws Exception {
send(packetProtocol, skipCurrentPipeline, false);
}
/**
* Send this packet to the associated user.
* Be careful not to send packets twice.
* (Sends it after current)
*
* @param packetProtocol - The protocol version of the packet.
* @param skipCurrentPipeline - Skip the current pipeline
* @param currentThread - Run in the same thread
* @throws Exception if it fails to write
*/
public void send(Class<? extends Protocol> packetProtocol, boolean skipCurrentPipeline, boolean currentThread) throws Exception {
if (!isCancelled()) {
ByteBuf output = constructPacket(packetProtocol, skipCurrentPipeline);
user().sendRawPacket(output);
user().sendRawPacket(output, currentThread);
}
}

View File

@ -162,7 +162,7 @@ public class WorldPackets {
output.setId(-1); // -1 for no writing of id
output.writeToBuffer(buffer);
PacketWrapper chunkPacket = new PacketWrapper(0x21, buffer, wrapper.user());
chunkPacket.send(Protocol1_9TO1_8.class, false);
chunkPacket.send(Protocol1_9TO1_8.class, false, true);
}
}
});