From 90797d12f41907b60f0dd868ad2a8e39df635753 Mon Sep 17 00:00:00 2001 From: wizjany Date: Mon, 25 Feb 2019 18:15:26 -0500 Subject: [PATCH] Skip legacy materials when setting up registries. Doesn't make a difference normally, but avoids errors in special envs. --- .../main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 4 ++-- 1 file changed, 2 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 6509db543..640e07338 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 @@ -132,7 +132,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { } // Block & Item for (Material material : Material.values()) { - if (material.isBlock()) { + if (material.isBlock() && !material.isLegacy()) { BlockType.REGISTRY.register(material.getKey().toString(), new BlockType(material.getKey().toString(), blockState -> { // TODO Use something way less hacky than this. ParserContext context = new ParserContext(); @@ -154,7 +154,7 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter { } })); } - if (material.isItem()) { + if (material.isItem() && !material.isLegacy()) { ItemType.REGISTRY.register(material.getKey().toString(), new ItemType(material.getKey().toString())); } }