SPIGOT-6810: Improve / fix biome setting code

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-11-27 16:42:28 +11:00
parent 27643e5df2
commit 4b8394a81b
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);
}
}