mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-18 06:41:08 +00:00
woops wrong height
This commit is contained in:
+10
-7
@@ -42,6 +42,9 @@ public record MCATerrainChunk(ChunkAccess chunk) implements TerrainChunk {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int y, int z, Biome bio) {
|
public void setBiome(int x, int y, int z, Biome bio) {
|
||||||
|
if (y < 0) return;
|
||||||
|
y += getMinHeight();
|
||||||
|
if (y > getMaxHeight()) return;
|
||||||
chunk.setBiome(x & 15, y, z & 15, CraftBiome.bukkitToMinecraftHolder(bio));
|
chunk.setBiome(x & 15, y, z & 15, CraftBiome.bukkitToMinecraftHolder(bio));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,9 +64,9 @@ public record MCATerrainChunk(ChunkAccess chunk) implements TerrainChunk {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBlock(int x, int y, int z, BlockData blockData) {
|
public void setBlock(int x, int y, int z, BlockData blockData) {
|
||||||
if (y > getMaxHeight() || y < getMinHeight()) {
|
if (y < 0) return;
|
||||||
return;
|
y += getMinHeight();
|
||||||
}
|
if (y > getMaxHeight()) return;
|
||||||
|
|
||||||
if (blockData == null) {
|
if (blockData == null) {
|
||||||
Iris.error("NULL BD");
|
Iris.error("NULL BD");
|
||||||
@@ -76,14 +79,14 @@ public record MCATerrainChunk(ChunkAccess chunk) implements TerrainChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private BlockState getBlockState(int x, int y, int z) {
|
private BlockState getBlockState(int x, int y, int z) {
|
||||||
|
if (y < 0) {
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
y += getMinHeight();
|
||||||
if (y > getMaxHeight()) {
|
if (y > getMaxHeight()) {
|
||||||
y = getMaxHeight();
|
y = getMaxHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y < getMinHeight()) {
|
|
||||||
y = getMinHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
return chunk.getBlockState(new BlockPos(x & 15, y, z & 15));
|
return chunk.getBlockState(new BlockPos(x & 15, y, z & 15));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user