Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
fix chunk unload packet
Dieser Commit ist enthalten in:
Ursprung
cf0bd6f021
Commit
34c701e039
@ -121,16 +121,20 @@ public class WorldPackets {
|
||||
@Override
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
ClientChunks clientChunks = wrapper.user().get(ClientChunks.class);
|
||||
Chunk1_8 chunk = (Chunk1_8) wrapper.passthrough(new Chunk1_9to1_8Type(clientChunks));
|
||||
Chunk1_9to1_8Type type = new Chunk1_9to1_8Type(clientChunks);
|
||||
Chunk1_8 chunk = (Chunk1_8) wrapper.read(type);
|
||||
if (chunk.isUnloadPacket()) {
|
||||
wrapper.setId(0x1D);
|
||||
|
||||
wrapper.write(Type.INT, chunk.getX());
|
||||
wrapper.write(Type.INT, chunk.getZ());
|
||||
// Remove commandBlocks on chunk unload
|
||||
CommandBlockProvider provider = Via.getManager().getProviders().get(CommandBlockProvider.class);
|
||||
provider.unloadChunk(wrapper.user(), chunk.getX(), chunk.getZ());
|
||||
}
|
||||
|
||||
} else {
|
||||
wrapper.write(type, chunk);
|
||||
// eat any other data (Usually happens with unload packets)
|
||||
}
|
||||
wrapper.read(Type.REMAINING_BYTES);
|
||||
}
|
||||
});
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren