From 4d4f341595c0486f22c39096bdec0965b564a616 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 14 Jul 2024 18:31:28 -0700 Subject: [PATCH] Fix incorrect coordinate for BlockState lookup It was fastecause it was wrong! It now only appears marginally faster. --- .../moonrise/mixin/random_ticking/ServerLevelMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ca/spottedleaf/moonrise/mixin/random_ticking/ServerLevelMixin.java b/src/main/java/ca/spottedleaf/moonrise/mixin/random_ticking/ServerLevelMixin.java index 28fb358..f2915aa 100644 --- a/src/main/java/ca/spottedleaf/moonrise/mixin/random_ticking/ServerLevelMixin.java +++ b/src/main/java/ca/spottedleaf/moonrise/mixin/random_ticking/ServerLevelMixin.java @@ -92,7 +92,7 @@ public abstract class ServerLevelMixin extends Level implements WorldGenLevel { 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);