diff --git a/src/main/java/net/minestom/server/entity/EquipmentSlot.java b/src/main/java/net/minestom/server/entity/EquipmentSlot.java index 3b66c7d68..2fa5bc189 100644 --- a/src/main/java/net/minestom/server/entity/EquipmentSlot.java +++ b/src/main/java/net/minestom/server/entity/EquipmentSlot.java @@ -3,6 +3,8 @@ package net.minestom.server.entity; import net.minestom.server.item.attribute.AttributeSlot; import org.jetbrains.annotations.NotNull; +import java.util.List; + import static net.minestom.server.utils.inventory.PlayerInventoryUtils.*; public enum EquipmentSlot { @@ -13,6 +15,8 @@ public enum EquipmentSlot { CHESTPLATE(true, CHESTPLATE_SLOT), HELMET(true, HELMET_SLOT); + private static final List ARMORS = List.of(BOOTS, LEGGINGS, CHESTPLATE, HELMET); + private final boolean armor; private final int armorSlot; @@ -33,7 +37,11 @@ public enum EquipmentSlot { return armorSlot; } - public static EquipmentSlot fromAttributeSlot(@NotNull AttributeSlot attributeSlot) { + public static @NotNull List<@NotNull EquipmentSlot> armors() { + return ARMORS; + } + + public static @NotNull EquipmentSlot fromAttributeSlot(@NotNull AttributeSlot attributeSlot) { return switch (attributeSlot) { case MAINHAND -> MAIN_HAND; case OFFHAND -> OFF_HAND;