3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-30 19:08:03 +02:00

Send the chunkbulk packets immediately. Fixes #535

Dieser Commit ist enthalten in:
Matsv 2016-11-16 17:15:36 +01:00
Ursprung 8e3b8cb572
Commit df3be302af
2 geänderte Dateien mit 16 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}
});