Package net.xun.lib.common.api.inventory
Enum Class PlayerInventorySection
- All Implemented Interfaces:
Serializable,Comparable<PlayerInventorySection>,Constable
Represents inventory sections with dynamic slot ranges and validation.
Provides both predefined player inventory sections and tools for creating custom slot ranges. Handles container size validation and inverted ranges automatically.
Predefined Sections (Minecraft Player Inventory):
HOTBAR(0-8 inclusive)MAIN_INVENTORY(9-35 inclusive)ARMOR(36-39 inclusive)OFFHAND(slot 40)ALL(0-40 inclusive)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionintgetEnd()Creates a dynamic slot range that adapts to container size.intgetStart()booleanmatches(int slot) Checks if a slot belongs to this section in a standard player inventory.static PlayerInventorySectionReturns the enum constant of this class with the specified name.static PlayerInventorySection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HOTBAR
-
MAIN_INVENTORY
-
ARMOR
-
OFFHAND
-
ALL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getStart
public int getStart() -
getEnd
public int getEnd() -
getSlotRange
Creates a dynamic slot range that adapts to container size. -
matches
public boolean matches(int slot) Checks if a slot belongs to this section in a standard player inventory.
-