mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-20 22:18:58 +01:00
SPIGOT-5529: BiomeGrid uses incorrect indexing
This commit is contained in:
parent
6881a10803
commit
3c9a4a3ba6
1 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin
|
||||||
|
|
||||||
private class CustomBiomeGrid implements BiomeGrid {
|
private class CustomBiomeGrid implements BiomeGrid {
|
||||||
|
|
||||||
private final BiomeStorage biome;
|
private final BiomeStorage biome; // SPIGOT-5529: stored in 4x4 grid
|
||||||
|
|
||||||
public CustomBiomeGrid(BiomeStorage biome) {
|
public CustomBiomeGrid(BiomeStorage biome) {
|
||||||
this.biome = biome;
|
this.biome = biome;
|
||||||
|
@ -60,19 +60,19 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int z, Biome bio) {
|
public void setBiome(int x, int z, Biome bio) {
|
||||||
for (int y = 0; y < world.getWorld().getMaxHeight(); y++) {
|
for (int y = 0; y < world.getWorld().getMaxHeight(); y += 4) {
|
||||||
setBiome(x, y, z, bio);
|
setBiome(x, y, z, bio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int y, int z) {
|
public Biome getBiome(int x, int y, int z) {
|
||||||
return CraftBlock.biomeBaseToBiome(biome.getBiome(x, y, z));
|
return CraftBlock.biomeBaseToBiome(biome.getBiome(x >> 2, y >> 2, z >> 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBiome(int x, int y, int z, Biome bio) {
|
public void setBiome(int x, int y, int z, Biome bio) {
|
||||||
biome.setBiome(x, y, z, CraftBlock.biomeToBiomeBase(bio));
|
biome.setBiome(x >> 2, y >> 2, z >> 2, CraftBlock.biomeToBiomeBase(bio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue