Class GuiElementValueTypeString<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.GuiElementValueTypeString<G,C>
- All Implemented Interfaces:
IGuiInputElement<GuiElementValueTypeStringRenderPattern,,G, C> IGuiInputElementValueType<GuiElementValueTypeStringRenderPattern,G, C>
public class GuiElementValueTypeString<G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
extends Object
implements IGuiInputElementValueType<GuiElementValueTypeStringRenderPattern,G,C>
GUI element for value type that can be read from and written to strings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGuiElementValueTypeString.SubGuiValueTypeInfo<S extends ISubGuiBox,G extends org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<?>, C extends net.minecraft.world.inventory.AbstractContainerMenu> -
Constructor Summary
ConstructorsConstructorDescriptionGuiElementValueTypeString(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) voidsetInputString(String inputString) voidsetValidator(Predicate<IValue> validator) voidvoidsetValueInGui(GuiElementValueTypeStringRenderPattern 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
-
GuiElementValueTypeString
-
-
Method Details
-
setValue
- Specified by:
setValuein interfaceIGuiInputElementValueType<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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.
-
setInputString
-
setValidator
- Specified by:
setValidatorin interfaceIGuiInputElementValueType<GuiElementValueTypeStringRenderPattern,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu>
-
getValue
- Specified by:
getValuein interfaceIGuiInputElementValueType<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,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<GuiElementValueTypeStringRenderPattern,G extends net.minecraft.client.gui.screens.Screen, C extends net.minecraft.world.inventory.AbstractContainerMenu> - Returns:
- The symbol used to identify this element.
-
createSubGui
public GuiElementValueTypeStringRenderPattern<?,G, createSubGuiC> (int baseX, int baseY, int maxWidth, int maxHeight, G gui, C container) - Specified by:
createSubGuiin interfaceIGuiInputElement<GuiElementValueTypeStringRenderPattern,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.
-