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:
1 parent
9d08c54324
commit
56313ae74f
1 file changed
+4
-3
@@ -1,6 +1,7 @@
|
|||||||
package carpet.mixins;
|
package carpet.mixins;
|
||||||
|
|
||||||
import carpet.fakes.BiomeArrayInterface;
|
import carpet.fakes.BiomeArrayInterface;
|
||||||
|
import net.minecraft.class_5742;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -29,9 +30,9 @@ public class BiomeArray_getBiomeArrayMixin implements BiomeArrayInterface
|
|||||||
@Override
|
@Override
|
||||||
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
|
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
|
||||||
{
|
{
|
||||||
int int_4 = (pos.getX() >> 2) & HORIZONTAL_BIT_MASK;
|
int int_4 = class_5742.method_33100(pos.getX()) & HORIZONTAL_BIT_MASK;
|
||||||
int int_5 = MathHelper.clamp((pos.getY() >> 2)-field_28126, 0, field_28127);
|
int int_5 = MathHelper.clamp(class_5742.method_33100(pos.getY())-field_28126, 0, field_28127);
|
||||||
int int_6 = (pos.getZ() >> 2) & HORIZONTAL_BIT_MASK;
|
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;
|
data[(int_5 << (HORIZONTAL_SECTION_COUNT + HORIZONTAL_SECTION_COUNT)) | (int_6 << HORIZONTAL_SECTION_COUNT) | int_4] = what;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user