Enum Class EnchantSlot
- All Implemented Interfaces:
Serializable,Comparable<EnchantSlot>,Constable
An enumeration defining the exact indices and screen coordinates of the interactable
item slots utilized within the custom Enchanting Altar menu.
Centralizes these magic numbers to prevent drift and ensure consistency between container backend logic and UI frontend rendering.
-
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 TypeMethodDescriptionstatic net.minecraft.world.inventory.Slotcreate(EnchantSlot slotType, net.minecraft.world.Container container) Generates a new inventory slot tailored with specific placement and stacking rules according to its designated slot type.intindex()Retrieves the backend container index associated with this slot.static EnchantSlotReturns the enum constant of this class with the specified name.static EnchantSlot[]values()Returns an array containing the constants of this enum class, in the order they are declared.intx()Retrieves the visual X coordinate for the slot within the UI screen.inty()Retrieves the visual Y coordinate for the slot within the UI screen.
-
Enum Constant Details
-
TARGET
The primary target item slot (e.g., a Sword, Pickaxe, or Book). Mapped to index 0. -
FUEL
The fuel slot requiring Lapis Lazuli to execute enchantments. Mapped to index 1. -
SOURCE
The catalyst source slot, exclusively accepting Enchanted Books/Tomes. Mapped to index 2.
-
-
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
-
index
public int index()Retrieves the backend container index associated with this slot.- Returns:
- The slot integer index.
-
x
public int x()Retrieves the visual X coordinate for the slot within the UI screen.- Returns:
- The X coordinate in pixels.
-
y
public int y()Retrieves the visual Y coordinate for the slot within the UI screen.- Returns:
- The Y coordinate in pixels.
-