From 34398f09d5c0012d955d3fd2dc6fa4895155da6f Mon Sep 17 00:00:00 2001 From: fullwall Date: Thu, 11 Feb 2021 23:00:18 +0800 Subject: [PATCH] Allow unequipping of certain slots --- .../java/net/citizensnpcs/editor/GenericEquipperGUI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/net/citizensnpcs/editor/GenericEquipperGUI.java b/main/src/main/java/net/citizensnpcs/editor/GenericEquipperGUI.java index 3c5a80b22..0c77d1abb 100644 --- a/main/src/main/java/net/citizensnpcs/editor/GenericEquipperGUI.java +++ b/main/src/main/java/net/citizensnpcs/editor/GenericEquipperGUI.java @@ -104,13 +104,13 @@ public class GenericEquipperGUI extends InventoryMenuPage { @ClickHandler(slot = { 1, 5 }) public void setBoots(InventoryMenuSlot slot, CitizensInventoryClickEvent event) { - set(EquipmentSlot.BOOTS, event, (type) -> type.name().endsWith("BOOTS")); + set(EquipmentSlot.BOOTS, event, (type) -> type == Material.AIR || type.name().endsWith("BOOTS")); } @ClickHandler(slot = { 1, 3 }) public void setChest(InventoryMenuSlot slot, CitizensInventoryClickEvent event) { set(EquipmentSlot.CHESTPLATE, event, - (type) -> type.name().endsWith("CHESTPLATE") || type.name().equals("ELYTRA")); + (type) -> type == Material.AIR || type.name().endsWith("CHESTPLATE") || type.name().equals("ELYTRA")); } @ClickHandler(slot = { 1, 0 }) @@ -125,7 +125,7 @@ public class GenericEquipperGUI extends InventoryMenuPage { @ClickHandler(slot = { 1, 4 }) public void setLeggings(InventoryMenuSlot slot, CitizensInventoryClickEvent event) { - set(EquipmentSlot.LEGGINGS, event, (type) -> type.name().endsWith("LEGGINGS")); + set(EquipmentSlot.LEGGINGS, event, (type) -> type == Material.AIR || type.name().endsWith("LEGGINGS")); } @ClickHandler(slot = { 1, 1 })