Permalink
Browse files

Fix BlockType and ItemType registration for Sponge distributive

  • Loading branch information...
gamerforEA committed Dec 24, 2018
1 parent 2e62389 commit 66415dfa34d59dd02316f6d0615d90405470a1fa
Showing with 8 additions and 2 deletions.
  1. +8 −2 worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorldEdit.java
@@ -139,11 +139,17 @@ public void serverAboutToStart(GameAboutToStartServerEvent event) {

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);

0 comments on commit 66415df

Please sign in to comment.