From 66415dfa34d59dd02316f6d0615d90405470a1fa Mon Sep 17 00:00:00 2001 From: gamerforEA Date: Mon, 24 Dec 2018 22:19:05 +0400 Subject: [PATCH] Fix BlockType and ItemType registration for Sponge distributive --- .../com/sk89q/worldedit/sponge/SpongeWorldEdit.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java index 825190657..f9f085c38 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java @@ -139,11 +139,17 @@ public class SpongeWorldEdit { for (BlockType blockType : Sponge.getRegistry().getAllOf(BlockType.class)) { // TODO Handle blockstate stuff - com.sk89q.worldedit.world.block.BlockTypes.register(new com.sk89q.worldedit.world.block.BlockType(blockType.getId())); + String id = blockType.getId(); + if (!com.sk89q.worldedit.world.block.BlockType.REGISTRY.keySet().contains(id)) { + com.sk89q.worldedit.world.block.BlockTypes.register(new com.sk89q.worldedit.world.block.BlockType(id)); + } } for (ItemType itemType : Sponge.getRegistry().getAllOf(ItemType.class)) { - ItemTypes.register(new com.sk89q.worldedit.world.item.ItemType(itemType.getId())); + String id = itemType.getId(); + if (!com.sk89q.worldedit.world.item.ItemType.REGISTRY.keySet().contains(id)) { + ItemTypes.register(new com.sk89q.worldedit.world.item.ItemType(id)); + } } WorldEdit.getInstance().getPlatformManager().register(platform);