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

public static final class EnchantWidget.Maxed extends EnchantWidget
Represents a non-interactable enchantment slot where the target item's enchantment has reached its natural maximum level.

This widget provides visual feedback to the player that no further standard upgrades are possible for this specific enchantment, utilizing a distinct texture and text color.

  • Constructor Details

    • Maxed

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

    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Denies all interaction with this widget, as maxed enchantments cannot be upgraded.
      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 maxed-out background texture and 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 for animations.