Class GuiElementValueTypeDropdownList<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>

java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.variable.gui.GuiElementValueTypeDropdownList<T,G,C>
All Implemented Interfaces:
IGuiInputElement<RenderPattern,G,C>, IGuiInputElementValueType<RenderPattern,G,C>, IDropdownEntryListener<T>

public class GuiElementValueTypeDropdownList<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu> extends Object implements IGuiInputElementValueType<RenderPattern,G,C>, IDropdownEntryListener<T>
GUI element for value type that are displayed using a dropdown list.
  • Constructor Details

  • Method Details

    • setValidator

      public void setValidator(Predicate<IValue> validator)
      Specified by:
      setValidator in interface IGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
    • setValue

      public void setValue(IValue value)
      Specified by:
      setValue in interface IGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
    • setValueInGui

      public void setValueInGui(RenderPattern subGui, boolean sendToServer)
      Description copied from interface: IGuiInputElementValueType
      Set the currently stored value in the given sub gui. This is useful when the gui is reused for multiple elements where the actual value is stored in this element.
      Specified by:
      setValueInGui in interface IGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Parameters:
      subGui - The sub gui to put the currently stored value in.
      sendToServer - If the value must be sent to the server.
    • getValue

      public IValue getValue()
      Specified by:
      getValue in interface IGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
    • getName

      public net.minecraft.network.chat.Component getName()
      Specified by:
      getName in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Returns:
      Name used for rendering.
    • loadTooltip

      public void loadTooltip(List<net.minecraft.network.chat.Component> lines)
      Specified by:
      loadTooltip in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Parameters:
      lines - The list to add tooltip lines to.
    • getRenderPattern

      public IConfigRenderPattern getRenderPattern()
      Specified by:
      getRenderPattern in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Returns:
      The render pattern.
    • activate

      public void activate()
      Description copied from interface: IGuiInputElement
      Called when this element is activated.
      Specified by:
      activate in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
    • deactivate

      public void deactivate()
      Description copied from interface: IGuiInputElement
      Called when this element is deactivated.
      Specified by:
      deactivate in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
    • validate

      public net.minecraft.network.chat.Component validate()
      Description copied from interface: IGuiInputElement
      Validates the current state of the element.
      Specified by:
      validate in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Returns:
      An error or null.
    • getColor

      public int getColor()
      Specified by:
      getColor in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Returns:
      The color used to identify this element.
    • getSymbol

      public String getSymbol()
      Specified by:
      getSymbol in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Returns:
      The symbol used to identify this element.
    • onSetDropdownPossiblity

      public void onSetDropdownPossiblity(IDropdownEntry dropdownEntry)
      Description copied from interface: IDropdownEntryListener
      Will be called when a dropdown entry is selected or completely matches.
      Specified by:
      onSetDropdownPossiblity in interface IDropdownEntryListener<T>
      Parameters:
      dropdownEntry - The selected entry.
    • createSubGui

      public GuiElementValueTypeDropdownListRenderPattern<T,?,G,C> createSubGui(int baseX, int baseY, int maxWidth, int maxHeight, G gui, C container)
      Specified by:
      createSubGui in interface IGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
      Parameters:
      baseX - Base x
      baseY - Base y
      maxWidth - Max width
      maxHeight - Max height
      gui - The parent gui
      container - The parent container
      Returns:
      A subgui that is shown when activated.