Fixed 1.2.5 -> 1.3 PRE_CHUNK translation

This commit is contained in:
RaphiMC 2024-09-20 11:29:23 +02:00
parent 883f4085bc
commit 4dc2b7c03e
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 7 additions and 7 deletions

View File

@ -136,7 +136,7 @@ public class Protocola1_2_3_5_1_2_6Tob1_0_1_1_1 extends StatelessProtocol<Client
public void register() {
map(Types.INT); // chunkX
map(Types.INT); // chunkZ
map(Types.UNSIGNED_BYTE); // mode
map(Types.BOOLEAN); // mode
handler(wrapper -> wrapper.user().get(InventoryStorage.class).unload(wrapper.get(Types.INT, 0), wrapper.get(Types.INT, 1)));
}
});

View File

@ -426,17 +426,17 @@ public class Protocolr1_2_4_5Tor1_3_1_2 extends StatelessProtocol<ClientboundPac
this.registerClientbound(ClientboundPackets1_2_4.PRE_CHUNK, ClientboundPackets1_3_1.LEVEL_CHUNK, wrapper -> {
final int chunkX = wrapper.read(Types.INT); // x
final int chunkZ = wrapper.read(Types.INT); // z
final short mode = wrapper.read(Types.UNSIGNED_BYTE); // mode
final boolean load = mode != 0;
final boolean load = wrapper.read(Types.BOOLEAN); // mode
wrapper.user().get(ChestStateTracker.class).unload(chunkX, chunkZ);
if (!load) {
final Chunk chunk = new BaseChunk(chunkX, chunkZ, true, false, 0, new ChunkSection[16], null, new ArrayList<>());
wrapper.write(Types1_7_6.getChunk(wrapper.user().getClientWorld(Protocolr1_2_4_5Tor1_3_1_2.class).getEnvironment()), chunk);
final Chunk chunk;
if (load) {
chunk = ChunkUtil.createEmptyChunk(chunkX, chunkZ);
} else {
wrapper.cancel();
chunk = new BaseChunk(chunkX, chunkZ, true, false, 0, new ChunkSection[16], null, new ArrayList<>());
}
wrapper.write(Types1_7_6.getChunk(wrapper.user().getClientWorld(Protocolr1_2_4_5Tor1_3_1_2.class).getEnvironment()), chunk);
});
this.registerClientbound(ClientboundPackets1_2_4.LEVEL_CHUNK, wrapper -> {
final Environment dimension = wrapper.user().getClientWorld(Protocolr1_2_4_5Tor1_3_1_2.class).getEnvironment();