From 7cf88aff65697721226bc01571dd00e34bd413bc Mon Sep 17 00:00:00 2001 From: Aurora Date: Sun, 23 Aug 2020 18:28:51 +0200 Subject: [PATCH 1/2] fix 1.16.2 support --- .../fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java | 4 ++-- .../worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java index 63cc0b050..398d0f6e3 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java @@ -84,7 +84,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks { } else { base = index.getBiome(x >> 2, y >> 2, z >> 2); } - return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(base)) : null; + return base != null ? BukkitAdapter.adapt(CraftBlock.biomeBaseToBiome(world.r().b(IRegistry.ay), base)) : null; } @Override @@ -350,7 +350,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks { final BiomeType biome = biomes[i]; if (biome != null) { final Biome craftBiome = BukkitAdapter.adapt(biome); - BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(craftBiome); + 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); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java index 6e4f90aa0..0c37bb722 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java @@ -49,6 +49,7 @@ import com.sk89q.worldedit.world.registry.BlockMaterial; import net.minecraft.server.v1_16_R2.*; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.Server; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.v1_16_R2.CraftChunk; import org.bukkit.craftbukkit.v1_16_R2.CraftWorld; @@ -449,7 +450,7 @@ public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements I @Override public int getInternalBiomeId(BiomeType biome) { - BiomeBase base = CraftBlock.biomeToBiomeBase(BukkitAdapter.adapt(biome)); - return IRegistry.BIOME.a(base); + BiomeBase base = CraftBlock.biomeToBiomeBase(MinecraftServer.getServer().aX().b(IRegistry.ay),BukkitAdapter.adapt(biome)); + return MinecraftServer.getServer().aX().b(IRegistry.ay).a(base); } } From 07c5e651665134d4b4c868a0d862ecb0d9b6c8aa Mon Sep 17 00:00:00 2001 From: Aurora Date: Sun, 23 Aug 2020 18:31:33 +0200 Subject: [PATCH 2/2] fix critical error --- .../fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java | 2 +- .../worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java index 398d0f6e3..05772624d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java @@ -350,7 +350,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks { final BiomeType biome = biomes[i]; if (biome != null) { final Biome craftBiome = BukkitAdapter.adapt(biome); - BiomeBase nmsBiome = CraftBlock.biomeToBiomeBase(nmsWorld.r().b(IRegistry.ay) ,craftBiome); + 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); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java index 0c37bb722..2bdc2aac0 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/FAWE_Spigot_v1_16_R2.java @@ -450,7 +450,7 @@ public final class FAWE_Spigot_v1_16_R2 extends CachedBukkitAdapter implements I @Override public int getInternalBiomeId(BiomeType biome) { - BiomeBase base = CraftBlock.biomeToBiomeBase(MinecraftServer.getServer().aX().b(IRegistry.ay),BukkitAdapter.adapt(biome)); + BiomeBase base = CraftBlock.biomeToBiomeBase(MinecraftServer.getServer().aX().b(IRegistry.ay), BukkitAdapter.adapt(biome)); return MinecraftServer.getServer().aX().b(IRegistry.ay).a(base); } }