Fix placement of negative section biomes

This commit is contained in:
themode 2021-12-20 01:07:27 +01:00 committed by TheMode
parent b17c66e339
commit 9174742429
2 changed files with 5 additions and 3 deletions

View File

@ -94,7 +94,7 @@ public class AnvilLoader implements IChunkLoader {
HashMap<String, Biome> biomeCache = new HashMap<>();
for (ChunkSection section : fileChunk.getSections().values()) {
if(section.getEmpty()) continue;
if (section.getEmpty()) continue;
for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) {
for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {

View File

@ -87,8 +87,10 @@ public class DynamicChunk extends Chunk {
public void setBiome(int x, int y, int z, @NotNull Biome biome) {
this.chunkCache.invalidate();
Section section = getSectionAt(y);
section.biomePalette()
.set(toChunkRelativeCoordinate(x) / 4, y / 4, toChunkRelativeCoordinate(z) / 4, biome.id());
section.biomePalette().set(
toChunkRelativeCoordinate(x) / 4,
toChunkRelativeCoordinate(y) / 4,
toChunkRelativeCoordinate(z) / 4, biome.id());
}
@Override