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 Summary
ConstructorsConstructorDescriptionGuiElementValueTypeDropdownList(IValueType valueType, IConfigRenderPattern renderPattern) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Called when this element is activated.createSubGui(int baseX, int baseY, int maxWidth, int maxHeight, G gui, C container) voidCalled when this element is deactivated.intgetColor()net.minecraft.network.chat.ComponentgetName()getValue()voidloadTooltip(List<net.minecraft.network.chat.Component> lines) voidonSetDropdownPossiblity(IDropdownEntry dropdownEntry) Will be called when a dropdown entry is selected or completely matches.voidsetValidator(Predicate<IValue> validator) voidvoidsetValueInGui(RenderPattern subGui, boolean sendToServer) Set the currently stored value in the given sub gui.net.minecraft.network.chat.Componentvalidate()Validates the current state of the element.
-
Constructor Details
-
GuiElementValueTypeDropdownList
-
-
Method Details
-
setValidator
- Specified by:
setValidatorin interfaceIGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu>
-
setValue
- Specified by:
setValuein interfaceIGuiInputElementValueType<T,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu>
-
setValueInGui
Description copied from interface:IGuiInputElementValueTypeSet 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:
setValueInGuiin interfaceIGuiInputElementValueType<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
- Specified by:
getValuein interfaceIGuiInputElementValueType<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:
getNamein interfaceIGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu> - Returns:
- Name used for rendering.
-
loadTooltip
- Specified by:
loadTooltipin interfaceIGuiInputElement<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
- Specified by:
getRenderPatternin interfaceIGuiInputElement<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:IGuiInputElementCalled when this element is activated.- Specified by:
activatein interfaceIGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu>
-
deactivate
public void deactivate()Description copied from interface:IGuiInputElementCalled when this element is deactivated.- Specified by:
deactivatein interfaceIGuiInputElement<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:IGuiInputElementValidates the current state of the element.- Specified by:
validatein interfaceIGuiInputElement<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:
getColorin interfaceIGuiInputElement<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
- Specified by:
getSymbolin interfaceIGuiInputElement<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
Description copied from interface:IDropdownEntryListenerWill be called when a dropdown entry is selected or completely matches.- Specified by:
onSetDropdownPossiblityin interfaceIDropdownEntryListener<T>- Parameters:
dropdownEntry- The selected entry.
-
createSubGui
public GuiElementValueTypeDropdownListRenderPattern<T,?, createSubGuiG, C> (int baseX, int baseY, int maxWidth, int maxHeight, G gui, C container) - Specified by:
createSubGuiin interfaceIGuiInputElement<T,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu> - Parameters:
baseX- Base xbaseY- Base ymaxWidth- Max widthmaxHeight- Max heightgui- The parent guicontainer- The parent container- Returns:
- A subgui that is shown when activated.
-