Skip to content

Commit

Permalink
Fix viewport using incorrect division logic for chunk coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Sep 15, 2024
1 parent 4b8f3cc commit 3801871
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public Viewport(Frustum frustum, Vector3d position) {
this.transform = new CameraTransform(position.x, position.y, position.z);

this.chunkCoords = SectionPos.of(
Mth.floor(position.x) / 16,
Mth.floor(position.y) / 16,
Mth.floor(position.z) / 16
Mth.floor(position.x) >> 4,
Mth.floor(position.y) >> 4,
Mth.floor(position.z) >> 4
);

this.blockCoords = new BlockPos(position.x, position.y, position.z);
Expand Down

0 comments on commit 3801871

Please sign in to comment.