using more standard approach to what mojang is using. JIT should inline that anyways. not broken, but closes / fixes #604

This commit is contained in:
gnembon committed 2020-12-03 22:02:01 -04:00
1 parent 9d08c54324
commit 56313ae74f
1 file changed
+4 -3
@@ -1,6 +1,7 @@
package carpet.mixins;
import carpet.fakes.BiomeArrayInterface;
import net.minecraft.class_5742;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
@@ -29,9 +30,9 @@ public class BiomeArray_getBiomeArrayMixin implements BiomeArrayInterface
@Override
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
{
int int_4 = (pos.getX() >> 2) & HORIZONTAL_BIT_MASK;
int int_5 = MathHelper.clamp((pos.getY() >> 2)-field_28126, 0, field_28127);
int int_6 = (pos.getZ() >> 2) & HORIZONTAL_BIT_MASK;
int int_4 = class_5742.method_33100(pos.getX()) & HORIZONTAL_BIT_MASK;
int int_5 = MathHelper.clamp(class_5742.method_33100(pos.getY())-field_28126, 0, field_28127);
int int_6 = class_5742.method_33100(pos.getZ()) & HORIZONTAL_BIT_MASK;
data[(int_5 << (HORIZONTAL_SECTION_COUNT + HORIZONTAL_SECTION_COUNT)) | (int_6 << HORIZONTAL_SECTION_COUNT) | int_4] = what;
}
}