From 95c819684cf5e8546066141ad738168d7eed62c3 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 5 Apr 2019 03:17:21 +1100 Subject: [PATCH] Use BiomeType here --- .../bukkit/v0/BukkitChunk_All_ReadonlySnapshot.java | 11 ++++++----- .../com/boydti/fawe/bukkit/v0/BukkitQueue_All.java | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitChunk_All_ReadonlySnapshot.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitChunk_All_ReadonlySnapshot.java index d8c8accfe..e00bb7ca7 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitChunk_All_ReadonlySnapshot.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitChunk_All_ReadonlySnapshot.java @@ -9,6 +9,7 @@ import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import java.util.*; +import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockTypes; import org.bukkit.ChunkSnapshot; import org.bukkit.block.Biome; @@ -55,16 +56,16 @@ public class BukkitChunk_All_ReadonlySnapshot extends FaweChunk { } @Override - public byte[] getBiomeArray() { + public BiomeType[] getBiomeArray() { if (!hasBiomes || next.biomes == null) return null; BukkitImplAdapter adapter = getParent().getAdapter(); - byte[] biomes = Arrays.copyOf(next.biomes, next.biomes.length); + BiomeType[] biomes = Arrays.copyOf(next.biomes, next.biomes.length); int index = 0; for (int z = 0; z < 16; z++) { for (int x = 0; x < 16; x++, index++) { - if (biomes[index] != 0) { + if (biomes[index] != null) { Biome biome = snapshot.getBiome(x, z); - biomes[index] = (byte) adapter.getBiomeId(biome); + biomes[index] = adapter.adapt(biome); } } } @@ -140,7 +141,7 @@ public class BukkitChunk_All_ReadonlySnapshot extends FaweChunk { } @Override - public void setBiome(int x, int z, byte biome) { + public void setBiome(int x, int z, BiomeType biome) { throw new UnsupportedOperationException("Read only"); } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java index 8960efd76..32c2c8436 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/v0/BukkitQueue_All.java @@ -22,6 +22,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentMap; import com.sk89q.worldedit.bukkit.BukkitAdapter; +import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; @@ -230,9 +231,9 @@ public class BukkitQueue_All extends BukkitQueue_0