Allow unequipping of certain slots

This commit is contained in:
fullwall 2021-02-11 23:00:18 +08:00
parent 352ec56f5e
commit 34398f09d5

View File

@ -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 })