Enum Class EnchantSlot

java.lang.Object
java.lang.Enum<EnchantSlot>
johnsmith.enchantingoverhauled.menu.enchant.model.EnchantSlot
All Implemented Interfaces:
Serializable, Comparable<EnchantSlot>, Constable

public enum EnchantSlot extends Enum<EnchantSlot>
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
    Enum Constant
    Description
    The fuel slot requiring Lapis Lazuli to execute enchantments.
    The catalyst source slot, exclusively accepting Enchanted Books/Tomes.
    The primary target item slot (e.g., a Sword, Pickaxe, or Book).
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.inventory.Slot
    create(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.
    int
    Retrieves the backend container index associated with this slot.
    Returns the enum constant of this class with the specified name.
    static EnchantSlot[]
    Returns an array containing the constants of this enum class, in the order they are declared.
    int
    x()
    Retrieves the visual X coordinate for the slot within the UI screen.
    int
    y()
    Retrieves the visual Y coordinate for the slot within the UI screen.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • TARGET

      public static final EnchantSlot TARGET
      The primary target item slot (e.g., a Sword, Pickaxe, or Book). Mapped to index 0.
    • FUEL

      public static final EnchantSlot FUEL
      The fuel slot requiring Lapis Lazuli to execute enchantments. Mapped to index 1.
    • SOURCE

      public static final EnchantSlot SOURCE
      The catalyst source slot, exclusively accepting Enchanted Books/Tomes. Mapped to index 2.
  • Method Details

    • values

      public static EnchantSlot[] 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

      public static EnchantSlot valueOf(String name)
      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 name
      NullPointerException - 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.
    • create

      public static net.minecraft.world.inventory.Slot create(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.
      Parameters:
      slotType - The enum classification defining the slot's index, coordinates, and rules.
      container - The underlying inventory container the slot will interact with.
      Returns:
      A newly constructed Slot implementation.