diff --git a/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java b/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java index 54367e68..48ad72f4 100644 --- a/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java +++ b/Compatibility/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java @@ -1277,7 +1277,7 @@ public enum CompatibleMaterial { YELLOW_WOOL("WOOL", (byte) 4), ZOMBIE_HEAD("SKULL_ITEM", (byte) 2), ZOMBIE_HORSE_SPAWN_EGG("MONSTER_EGG", (byte) 29), - ZOMBIE_PIGMAN_SPAWN_EGG("MONSTER_EGG", (byte) 57), + ZOMBIE_PIGMAN_SPAWN_EGG("MONSTER_EGG", (byte) 57), // FIXME: The name changed in newer versions (nether update maybe?) ZOMBIE_SPAWN_EGG("MONSTER_EGG", (byte) 54), ZOMBIE_VILLAGER_SPAWN_EGG("MONSTER_EGG", (byte) 27), ZOMBIE_WALL_HEAD("SKULL", (byte) 2), diff --git a/Core/src/main/java/com/songoda/core/configuration/editor/ConfigEditorGui.java b/Core/src/main/java/com/songoda/core/configuration/editor/ConfigEditorGui.java index d3649a7a..9ab71e8c 100644 --- a/Core/src/main/java/com/songoda/core/configuration/editor/ConfigEditorGui.java +++ b/Core/src/main/java/com/songoda/core/configuration/editor/ConfigEditorGui.java @@ -131,10 +131,17 @@ public class ConfigEditorGui extends SimplePagedGui { paged.setItem(4, configItem(CompatibleMaterial.FILLED_MAP, settingKey, node, settingKey, "Choose an item to change this value to")); int i = 9; for (CompatibleMaterial mat : CompatibleMaterial.getAllValidItemMaterials()) { - paged.setButton(i++, GuiUtils.createButtonItem(mat, mat.name()), ClickType.LEFT, (matEvent) -> { - setMaterial(event.slot, settingKey, matEvent.clickedItem); - matEvent.player.closeInventory(); - }); + try { + ItemStack buttonItem = GuiUtils.createButtonItem(mat, mat.name()); + if (!buttonItem.getType().isItem()) continue; + + paged.setButton(i++, buttonItem, ClickType.LEFT, (matEvent) -> { + setMaterial(event.slot, settingKey, matEvent.clickedItem); + matEvent.player.closeInventory(); + }); + } catch (IllegalArgumentException ex) { + // FIXME: CompatibleMaterial is not working properly for 'ZOMBIE_PIGMAN_SPAWN_EGG' + } } event.manager.showGUI(event.player, paged); });