SPIGOT-6810: Improve / fix biome setting code

This commit is contained in:
md_5 2021-11-27 16:42:28 +11:00
parent c98abfb0ff
commit 806bb02c17
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 3 additions and 3 deletions

View File

@ -734,7 +734,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setBiome(int x, int z, Biome bio) {
for (int y = 0; y < getMaxHeight(); y++) {
for (int y = getMinHeight(); y < getMaxHeight(); y++) {
setBiome(x, y, z, bio);
}
}
@ -746,7 +746,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
net.minecraft.world.level.chunk.Chunk chunk = this.world.getChunkAt(pos);
if (chunk != null) {
chunk.setBiome(x, y, z, bb);
chunk.setBiome(x >> 2, y >> 2, z >> 2, bb);
chunk.setUnsaved(true); // SPIGOT-2890
}

View File

@ -66,7 +66,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator {
@Override
public void setBiome(int x, int z, Biome bio) {
for (int y = 0; y < world.getWorld().getMaxHeight(); y += 4) {
for (int y = world.getWorld().getMinHeight(); y < world.getWorld().getMaxHeight(); y += 4) {
setBiome(x, y, z, bio);
}
}