fixes to set_biome to accomodate 3d biomes

This commit is contained in:
gnembon committed 2019-09-05 14:29:55 -03:00
1 parent faa8d54484
commit 8747f18836
4 files changed
+10 -11

No files matched your search

@@ -1,9 +1,9 @@
package carpet.mixins;
import carpet.fakes.class_4548Interface;
import carpet.settings.CarpetSettings;
import net.minecraft.class_4548;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
@@ -25,11 +25,10 @@ public class class_4548_getBiomeArrayMixin implements class_4548Interface
@Override
public void setBiomeAtIndex(BlockPos pos, World world, Biome what)
{
ChunkPos chunkPos = new ChunkPos(pos);
int seaLevel = world.getSeaLevel();
int int_4 = chunkPos.x & field_20650;
int seaLevel = 0;// seems to be a fixed value for now. world.getSeaLevel();
int int_4 = (pos.getX() >> 2) & field_20650;
int int_5 = MathHelper.clamp(seaLevel, 0, field_20651);
int int_6 = chunkPos.z & field_20650;
int int_6 = (pos.getZ() >> 2) & field_20650;
field_20654[int_5 << field_20652 + field_20652 | int_6 << field_20652 | int_4] = what;
}
}