From 40b024fbba9362893f7179a15fcfbc5fee4e3437 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 22 Sep 2021 16:15:18 +0100 Subject: [PATCH] Set legacy ID when adapter is loaded to enable reading/writing anvil --- .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index a8b266e70..ab64645ef 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -313,9 +313,12 @@ public class WorldEditPlugin extends JavaPlugin { // Biomes are stored globally in the server. Registries are not kept per-world in Minecraft. // The WorldServer get-registries method simply delegates to the MinecraftServer method. for (final NamespacedKey biome : ((BukkitImplAdapter) adapter.value().get()).getRegisteredBiomes()) { - if (BiomeType.REGISTRY.get(biome.toString()) == null) { // only register once - BiomeType.REGISTRY.register(biome.toString(), new BiomeType(biome.toString())); + BiomeType biomeType; + if ((biomeType = BiomeType.REGISTRY.get(biome.toString())) == null) { // only register once + biomeType = new BiomeType(biome.toString()); + BiomeType.REGISTRY.register(biome.toString(), biomeType); } + biomeType.setLegacyId(adapter.value().get().getInternalBiomeId(biomeType)); } } else { if (!expectFail) {