Skip to content

Commit

Permalink
Fix BlockType and ItemType registration for Sponge distributive
Browse files Browse the repository at this point in the history
  • Loading branch information
gamerforEA committed Dec 24, 2018
1 parent 2e62389 commit 66415df
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66415df

Please sign in to comment.