Permalink
Browse files

Merge pull request #440 from gamerforEA/master

Fix BlockType and ItemType registration for Sponge distributive
  • Loading branch information...
me4502 committed Dec 25, 2018
2 parents 514f821 + 66415df commit 976a92d5ea5c2a496086c14cb97d46b9501a89ee
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 976a92d

Please sign in to comment.