Skip to content

Commit

Permalink
Fix incorrect coordinate for BlockState lookup
Browse files Browse the repository at this point in the history
It was fastecause it was wrong! It now only appears
marginally faster.
  • Loading branch information
Spottedleaf committed Jul 15, 2024
1 parent b160a14 commit 4d4f341
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private LevelChunkSection[] optimiseRandomTick(final LevelChunk chunk,
final int randomX = (location & 15);
final int randomY = ((location >>> (4 + 4)) & 255);
final int randomZ = ((location >>> 4) & 15);
final BlockState state = states.get(randomX | (randomZ << 4) | (randomZ << 8));
final BlockState state = states.get(randomX | (randomZ << 4) | (randomY << 8));

// do not use a mutable pos, as some random tick implementations store the input without calling immutable()!
final BlockPos pos = new BlockPos(randomX | offsetX, randomY | offsetY, randomZ | offsetZ);
Expand Down

0 comments on commit 4d4f341

Please sign in to comment.