Skip legacy materials when setting up registries.

Doesn't make a difference normally, but avoids errors in special envs.
This commit is contained in:
wizjany 2019-02-25 18:15:26 -05:00
parent 2f734d4570
commit 90797d12f4

View File

@ -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()));
}
}