Full support for 3D biomes (#714)

* Full support for 3D biomes
Since we're only supporting 1.15+ there's no need to try anything other than compatibility

* this is not part of the PR

* Clipboards should still always be y 0 for biomes
(this "bug" has existed for ages)
This commit is contained in:
dordsor21
2020-10-22 22:18:16 +01:00
committed by GitHub
parent 28f5a7072d
commit c6ef1bc1de
28 changed files with 106 additions and 103 deletions

View File

@ -50,7 +50,7 @@ public class MCAChunk implements IChunk {
public final boolean[] hasSections = new boolean[16];
public boolean hasBiomes = false;
public final BiomeType[] biomes = new BiomeType[256];
public final BiomeType[] biomes = new BiomeType[1024];
public final char[] blocks = new char[65536];
@ -481,7 +481,7 @@ public class MCAChunk implements IChunk {
@Override
public BiomeType getBiomeType(int x, int y, int z) {
return this.biomes[(z << 4) | x];
return this.biomes[y << 2 | z & 12 | x >> 2];
}
@Override
@ -505,7 +505,7 @@ public class MCAChunk implements IChunk {
@Override
public boolean setBiome(int x, int y, int z, BiomeType biome) {
setModified();
biomes[x + (z << 4)] = biome; //TODO Support 3D Biomes
biomes[y << 2 | z & 12 | x >> 2] = biome;
return true;
}