Class EnchantWidget.Overleveled

java.lang.Object
johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget
johnsmith.enchantingoverhauled.client.gui.widget.enchant.EnchantWidget.Overleveled
Enclosing class:
EnchantWidget

public static final class EnchantWidget.Overleveled extends EnchantWidget
Represents a non-interactable enchantment slot where the target item's enchantment exceeds its natural maximum level (e.g., pushed beyond the limit via an Enchanted Tome).

Displays a unique visual style to indicate its special overleveled status.

  • Constructor Details

    • Overleveled

      public Overleveled(int x, int y, EnchantRenderState state, int texIndex, boolean usePlainBackground, Runnable onPressAction)
      Constructs a new EnchantWidget.Overleveled.
      Parameters:
      x - The initial X screen coordinate.
      y - The initial Y screen coordinate.
      state - The data state containing the overleveled enchantment information.
      texIndex - The deterministic texture index.
      usePlainBackground - Whether plain textures are enabled.
      onPressAction - The callback invoked on click (never called).
  • Method Details

    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Denies all interaction, as overleveled enchantments cannot be further upgraded directly.
      Overrides:
      mouseClicked in class EnchantWidget
      Parameters:
      mouseX - The X coordinate of the mouse pointer.
      mouseY - The Y coordinate of the mouse pointer.
      button - The mouse button being pressed.
      Returns:
      Always false.
    • renderWidget

      protected void renderWidget(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float partialTick)
      Renders the distinct overleveled background texture and deep purple text.
      Specified by:
      renderWidget in class EnchantWidget
      Parameters:
      context - The GUI graphics context.
      mouseX - The current mouse X coordinate.
      mouseY - The current mouse Y coordinate.
      partialTick - The partial tick time.