diff --git a/main/src/main/java/net/citizensnpcs/editor/EndermanEquipperGUI.java b/main/src/main/java/net/citizensnpcs/editor/EndermanEquipperGUI.java index 245b99621..30ac03f8d 100644 --- a/main/src/main/java/net/citizensnpcs/editor/EndermanEquipperGUI.java +++ b/main/src/main/java/net/citizensnpcs/editor/EndermanEquipperGUI.java @@ -33,7 +33,7 @@ import net.citizensnpcs.api.util.SpigotUtil; slots = { @MenuSlot( filter = InventoryAction.UNKNOWN, pat = 'x', - material = Material.GLASS_PANE, + compatMaterial = { "GLASS_PANE", "FIRE" }, title = "<4>Unused") }, value = "xxx") public class EndermanEquipperGUI extends InventoryMenuPage { diff --git a/main/src/main/java/net/citizensnpcs/editor/PigEquipperGUI.java b/main/src/main/java/net/citizensnpcs/editor/PigEquipperGUI.java index 068a9dbb9..2e6e71861 100644 --- a/main/src/main/java/net/citizensnpcs/editor/PigEquipperGUI.java +++ b/main/src/main/java/net/citizensnpcs/editor/PigEquipperGUI.java @@ -30,7 +30,7 @@ import net.citizensnpcs.trait.Saddle; slots = { @MenuSlot( filter = InventoryAction.UNKNOWN, pat = 'x', - material = Material.GLASS_PANE, + compatMaterial = { "GLASS_PANE", "FIRE" }, title = "<4>Unused") }, value = "xxx") public class PigEquipperGUI extends InventoryMenuPage { diff --git a/main/src/main/java/net/citizensnpcs/trait/DropsTrait.java b/main/src/main/java/net/citizensnpcs/trait/DropsTrait.java index 5c5eaae34..c12bbcb95 100644 --- a/main/src/main/java/net/citizensnpcs/trait/DropsTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/DropsTrait.java @@ -88,7 +88,8 @@ public class DropsTrait extends Trait { ctx.getInventory().setItem(islot, drop.drop.clone()); } InventoryMenuSlot slot = ctx.getSlot(i * 9 + j); - slot.setItemStack(new ItemStack(Material.GLASS_PANE), "Drop chance " + chance + "%"); + slot.setItemStack(new ItemStack(Util.getFallbackMaterial("GLASS_PANE", "FIRE")), + "Drop chance " + chance + "%"); slot.addClickHandler(new PercentageSlotHandler((pct) -> { if (chances.containsKey(islot)) { chances.put(islot, pct / 100.0); diff --git a/main/src/main/java/net/citizensnpcs/util/Util.java b/main/src/main/java/net/citizensnpcs/util/Util.java index 12b25ea23..fd401bb39 100644 --- a/main/src/main/java/net/citizensnpcs/util/Util.java +++ b/main/src/main/java/net/citizensnpcs/util/Util.java @@ -107,6 +107,14 @@ public class Util { return entity instanceof LivingEntity ? ((LivingEntity) entity).getEyeLocation() : entity.getLocation(); } + public static Material getFallbackMaterial(String first, String second) { + try { + return Material.valueOf(first); + } catch (IllegalArgumentException e) { + return Material.valueOf(second); + } + } + public static Random getFastRandom() { return new XORShiftRNG(); }