Class ValueTypeIngredientsLPElement
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeIngredientsLPElement
- All Implemented Interfaces:
IGuiInputElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> ILogicProgrammerElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> IValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
Element for the ingredients value type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classPanel for browsing through the list elements and updating them.protected static classSub gui that holds the list element value type panel and the panel for browsing through the elements.protected static classSelection panel for the type.Nested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
ValueTypeLPElementBase.ValueTypeVariableFacadeFactory -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Called when this element is activated.booleanprotected org.cyclops.commoncapabilities.api.ingredient.IMixedIngredientscreateSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) voidCalled when this element is deactivated.intgetType()getValue()protected <VT extends IValueType<V>,V extends IValue, T, M>
voidinitializeElementFromInstanceValue(Map<Integer, IValueTypeLogicProgrammerElement> entries, IIngredientComponentHandler<VT, V, T, M> handler, T instance, int instanceIndex) booleanisItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.voidremoveElement(int index) setActiveElement(int index) voidsetCurrentType(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent currentType) voidsetLength(int length) voidvoidvoidsetValueInContainer(ContainerLogicProgrammerBase container) Set the currently stored value in the given container.voidsetValueInGui(ISubGuiBox subGui) Set the currently stored value in the given sub gui.net.minecraft.network.chat.Componentvalidate()Validates the current state of the element.Methods inherited from class org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
canCurrentlyReadFromOtherItem, createInnerGuiElement, getColor, getInnerGuiElement, getItemStackSizeLimit, getMatchString, getName, getSymbol, isFocused, isFor, loadElement, loadTooltip, matchesInput, matchesOutput, onInputSlotUpdated, setFocused, slotClick, writeElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement
createSlotMethods inherited from interface org.cyclops.integrateddynamics.api.logicprogrammer.IValueTypeLogicProgrammerElement
getValueType
-
Field Details
-
OFFSET_X
protected static final int OFFSET_X- See Also:
-
OFFSET_Y
protected static final int OFFSET_Y- See Also:
-
-
Constructor Details
-
ValueTypeIngredientsLPElement
public ValueTypeIngredientsLPElement()
-
-
Method Details
-
setServerValue
-
getType
- Specified by:
getTypein interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
getTypein classValueTypeLPElementBase- Returns:
- The element type.
-
getRenderPattern
- Specified by:
getRenderPatternin interfaceIGuiInputElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
getRenderPatternin classValueTypeLPElementBase- Returns:
- The render pattern.
-
canWriteElementPre
public boolean canWriteElementPre()- Specified by:
canWriteElementPrein interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
canWriteElementPrein classValueTypeLPElementBase- Returns:
- If this element can be written to an item in its current state.
-
constructValues
protected org.cyclops.commoncapabilities.api.ingredient.IMixedIngredients constructValues() -
getValue
- Returns:
- The current value.
-
setValue
- Specified by:
setValuein interfaceIValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValuein classValueTypeLPElementBase- Parameters:
value- The new value.
-
initializeElementFromInstanceValue
protected <VT extends IValueType<V>,V extends IValue, void initializeElementFromInstanceValueT, M> (Map<Integer, IValueTypeLogicProgrammerElement> entries, IIngredientComponentHandler<VT, V, T, M> handler, T instance, int instanceIndex) -
setValueInGui
Description copied from interface:ILogicProgrammerElementSet 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 interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValueInGuiin classValueTypeLPElementBase- Parameters:
subGui- The sub gui to put the currently stored value in.
-
setValueInContainer
Description copied from interface:ILogicProgrammerElementSet the currently stored value in the given container. This is only relevant to values that use things like slots, which must be updated server-side as well.- Specified by:
setValueInContainerin interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValueInContainerin classValueTypeLPElementBase- Parameters:
container- The container to put the currently stored value in.
-
getLength
public int getLength() -
setLength
public void setLength(int length) -
setCurrentType
public void setCurrentType(org.cyclops.commoncapabilities.api.ingredient.IngredientComponent currentType) -
setActiveElement
-
removeElement
public void removeElement(int index) -
activate
public void activate()Description copied from interface:IGuiInputElementCalled when this element is activated.- Specified by:
activatein interfaceIGuiInputElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
activatein classValueTypeLPElementBase
-
deactivate
public void deactivate()Description copied from interface:IGuiInputElementCalled when this element is deactivated.- Specified by:
deactivatein interfaceIGuiInputElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
deactivatein classValueTypeLPElementBase
-
validate
public net.minecraft.network.chat.Component validate()Description copied from interface:IGuiInputElementValidates the current state of the element.- Returns:
- An error or null.
-
isItemValidForSlot
public boolean isItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Description copied from interface:ILogicProgrammerElementCheck if the given item can be inserted into the given slot.- Specified by:
isItemValidForSlotin interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
isItemValidForSlotin classValueTypeLPElementBase- Parameters:
slotId- The slot id.itemStack- The item that will be inserted.- Returns:
- If it can be inserted.
-
createSubGui
public ISubGuiBox createSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) - Specified by:
createSubGuiin interfaceIGuiInputElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Specified by:
createSubGuiin classValueTypeLPElementBase- Parameters:
baseX- Base xbaseY- Base ymaxWidth- Max widthmaxHeight- Max heightgui- The parent guicontainer- The parent container- Returns:
- A subgui that is shown when activated.
-