Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static chunk type instances #19

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
use static chunk type instances
FlorianMichael committed Oct 20, 2023

Verified

This commit was signed with the committer’s verified signature.
commit 54a1f42724e35570e74659d5ca8703173f7118a4
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ protected void registerPackets() {
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());

Original file line number Diff line number Diff line change
@@ -73,8 +73,8 @@ public void register() {
@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());