Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +01:00
Send the chunkbulk packets immediately. Fixes #535
Dieser Commit ist enthalten in:
Ursprung
8e3b8cb572
Commit
df3be302af
@ -283,9 +283,23 @@ public class PacketWrapper {
|
|||||||
* @throws Exception if it fails to write
|
* @throws Exception if it fails to write
|
||||||
*/
|
*/
|
||||||
public void send(Class<? extends Protocol> packetProtocol, boolean skipCurrentPipeline) throws Exception {
|
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()) {
|
if (!isCancelled()) {
|
||||||
ByteBuf output = constructPacket(packetProtocol, skipCurrentPipeline);
|
ByteBuf output = constructPacket(packetProtocol, skipCurrentPipeline);
|
||||||
user().sendRawPacket(output);
|
user().sendRawPacket(output, currentThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ public class WorldPackets {
|
|||||||
output.setId(-1); // -1 for no writing of id
|
output.setId(-1); // -1 for no writing of id
|
||||||
output.writeToBuffer(buffer);
|
output.writeToBuffer(buffer);
|
||||||
PacketWrapper chunkPacket = new PacketWrapper(0x21, buffer, wrapper.user());
|
PacketWrapper chunkPacket = new PacketWrapper(0x21, buffer, wrapper.user());
|
||||||
chunkPacket.send(Protocol1_9TO1_8.class, false);
|
chunkPacket.send(Protocol1_9TO1_8.class, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren