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

@ -419,14 +419,14 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks {
if (createCopy) {
copy.storeBiomes(currentBiomes);
}
for (int z = 0, i = 0; z < 16; z++) {
for (int x = 0; x < 16; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(craftBiome);
for (int y = 0; y < FaweCache.IMP.WORLD_HEIGHT; y++) {
currentBiomes.setBiome(x >> 2, y >> 2, z >> 2, nmsBiome);
for (int y = 0, i = 0; y < 64; y++) {
for (int z = 0; z < 4; z++) {
for (int x = 0; x < 4; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(craftBiome);
currentBiomes.setBiome(x, y, z, nmsBiome);
}
}
}

View File

@ -421,14 +421,14 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks {
if (createCopy) {
copy.storeBiomes(currentBiomes);
}
for (int z = 0, i = 0; z < 16; z++) {
for (int x = 0; x < 16; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(craftBiome);
for (int y = 0; y < FaweCache.IMP.WORLD_HEIGHT; y++) {
currentBiomes.setBiome(x >> 2, y >> 2, z >> 2, nmsBiome);
for (int y = 0, i = 0; y < 64; y++) {
for (int z = 0; z < 4; z++) {
for (int x = 0; x < 4; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(craftBiome);
currentBiomes.setBiome(x, y, z, nmsBiome);
}
}
}

View File

@ -59,6 +59,7 @@ import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nullable;
import java.util.AbstractSet;
import java.util.Arrays;
import java.util.Collection;
@ -72,7 +73,6 @@ import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.function.Function;
import javax.annotation.Nullable;
import static org.slf4j.LoggerFactory.getLogger;
@ -424,14 +424,14 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks {
if (createCopy) {
copy.storeBiomes(currentBiomes);
}
for (int z = 0, i = 0; z < 16; z++) {
for (int x = 0; x < 16; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(nmsWorld.r().b(IRegistry.ay), craftBiome);
for (int y = 0; y < FaweCache.IMP.WORLD_HEIGHT; y++) {
currentBiomes.setBiome(x >> 2, y >> 2, z >> 2, nmsBiome);
for (int y = 0, i = 0; y < 64; y++) {
for (int z = 0; z < 4; z++) {
for (int x = 0; x < 4; x++, i++) {
final BiomeType biome = biomes[i];
if (biome != null) {
final Biome craftBiome = BukkitAdapter.adapt(biome);
BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(nmsWorld.r().b(IRegistry.ay), craftBiome);
currentBiomes.setBiome(x, y, z, nmsBiome);
}
}
}