use static chunk type instances

This commit is contained in:
FlorianMichael 2023-10-20 09:54:05 +02:00
parent 462e68a0af
commit 54a1f42724
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ public class Protocol1_14to3D_Shareware extends BackwardsProtocol<ClientboundPac
this.registerClientbound(ClientboundPackets3D_Shareware.CHUNK_DATA, wrapper -> {
final ChunkCenterTracker3D_Shareware entityTracker = wrapper.user().get(ChunkCenterTracker3D_Shareware.class);
final Chunk chunk = wrapper.passthrough(new ChunkType1_14());
final Chunk chunk = wrapper.passthrough(ChunkType1_14.TYPE);
final int diffX = Math.abs(entityTracker.getChunkCenterX() - chunk.getX());
final int diffZ = Math.abs(entityTracker.getChunkCenterZ() - chunk.getZ());

View File

@ -73,8 +73,8 @@ public class BlockItemPackets20w14infinite extends ItemRewriter<ClientboundPacke
@Override
public void register() {
handler(wrapper -> {
Chunk chunk = wrapper.read(new ChunkType1_15());
wrapper.write(new ChunkType1_16(), chunk);
Chunk chunk = wrapper.read(ChunkType1_15.TYPE);
wrapper.write(ChunkType1_16.TYPE, chunk);
chunk.setIgnoreOldLightData(chunk.isFullChunk());