Class ColorEntry<P extends Property<Integer>>

All Implemented Interfaces:
ConfigEntry, net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement
Direct Known Subclasses:
ARGBColorEntry, RGBColorEntry

public abstract class ColorEntry<P extends Property<Integer>> extends BoundedEntry<Integer>
  • Constructor Details

    • ColorEntry

      public ColorEntry(P property, ConfigScreen parentScreen, net.minecraft.client.Minecraft minecraft, Runnable onValueChanged)
  • Method Details

    • getHexFormatString

      protected abstract String getHexFormatString()
    • getMaxLength

      protected abstract int getMaxLength()
    • getPreviewColor

      protected abstract int getPreviewColor(int rawValue)
    • formatColorString

      protected abstract net.minecraft.util.FormattedCharSequence formatColorString(String text, int cursorOffset)
    • parse

      protected Integer parse(String input) throws NumberFormatException
      Specified by:
      parse in class BoundedEntry<Integer>
      Throws:
      NumberFormatException
    • getRegexFilter

      protected String getRegexFilter()
      Specified by:
      getRegexFilter in class BoundedEntry<Integer>
    • isPartialInput

      protected boolean isPartialInput(String input)
      Specified by:
      isPartialInput in class BoundedEntry<Integer>
    • setupEditBox

      protected void setupEditBox(net.minecraft.client.gui.components.EditBox box)
      Description copied from class: AbstractTextEntry
      Attaches live responders or input filters to the EditBox (e.g., coloring text red on invalid input).
      Overrides:
      setupEditBox in class BoundedEntry<Integer>
    • updateWidgetValue

      protected void updateWidgetValue()
      Specified by:
      updateWidgetValue in class OptionEntry<Integer, net.minecraft.client.gui.components.EditBox>
    • isWithinBounds

      protected Boolean isWithinBounds(Integer value)
      Overrides:
      isWithinBounds in class BoundedEntry<Integer>
    • enforceHexFormatting

      protected void enforceHexFormatting()
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent event)
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent event)
    • renderColorPreview

      protected void renderColorPreview(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int boxX, int boxY, int boxSize, int baseColor, int mouseX, int mouseY)
    • renderNextColorPreviewTriangle

      protected void renderNextColorPreviewTriangle(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int boxX, int boxY, int boxSize, int color)
    • getCurrentValueTooltipText

      protected net.minecraft.network.chat.Component getCurrentValueTooltipText()
      Overrides:
      getCurrentValueTooltipText in class BoundedEntry<Integer>
    • getBoundsTooltipText

      protected net.minecraft.network.chat.Component getBoundsTooltipText()
      Overrides:
      getBoundsTooltipText in class BoundedEntry<Integer>
    • getDefaultValueTooltip

      protected net.minecraft.network.chat.Component getDefaultValueTooltip()
      Overrides:
      getDefaultValueTooltip in class OptionEntry<Integer, net.minecraft.client.gui.components.EditBox>
    • extractContent

      public void extractContent(@NotNull @NotNull net.minecraft.client.gui.GuiGraphicsExtractor guiGraphicsExtractor, int mouseX, int mouseY, boolean isHovering, float partialTick)
      Overrides:
      extractContent in class BoundedEntry<Integer>