mirror of
https://github.com/songoda/SongodaCore.git
synced 2024-11-23 10:35:18 +01:00
Fixes empty slots in ConfigEditorGui item select
This commit is contained in:
parent
a0050aadd6
commit
a42d03aec3
@ -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),
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user