Class ValueTypeItemStackLPElement<V extends IValue>
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeItemStackLPElement<V>
- All Implemented Interfaces:
IGuiInputElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> ILogicProgrammerElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> IValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
Element for a value type that can be derived from an
ItemStack.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceprotected static classNested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
ValueTypeLPElementBase.ValueTypeVariableFacadeFactory -
Constructor Summary
ConstructorsConstructorDescriptionValueTypeItemStackLPElement(IValueType valueType, ValueTypeItemStackLPElement.IItemStackToValue<V> itemStackToValue) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Called when this element is activated.booleancreateSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) voidCalled when this element is deactivated.intgetType()getValue()booleanisItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.voidonInputSlotUpdated(net.minecraft.world.entity.player.Player player, int slotId, net.minecraft.world.item.ItemStack itemStack) Called when an input item slot has been updated.voidvoidsetValueInContainer(ContainerLogicProgrammerBase container) Set the currently stored value in the given container.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, getMatchString, getName, getSymbol, isFocused, isFor, loadElement, loadTooltip, matchesInput, matchesOutput, setFocused, setValueInGui, 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
-
Constructor Details
-
ValueTypeItemStackLPElement
public ValueTypeItemStackLPElement(IValueType valueType, ValueTypeItemStackLPElement.IItemStackToValue<V> itemStackToValue)
-
-
Method Details
-
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.
-
getItemStackSizeLimit
public int getItemStackSizeLimit()- Specified by:
getItemStackSizeLimitin interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
getItemStackSizeLimitin classValueTypeLPElementBase- Returns:
- The max stacksize.
-
onInputSlotUpdated
public void onInputSlotUpdated(net.minecraft.world.entity.player.Player player, int slotId, net.minecraft.world.item.ItemStack itemStack) Description copied from interface:ILogicProgrammerElementCalled when an input item slot has been updated.- Specified by:
onInputSlotUpdatedin interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
onInputSlotUpdatedin classValueTypeLPElementBaseslotId- The slot id.itemStack- The itemstack currently in the slot, can be null.
-
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.
-
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.
-
getValue
- Returns:
- The current value.
-
setValue
- Specified by:
setValuein interfaceIValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValuein classValueTypeLPElementBase- Parameters:
value- The new value.
-
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.
-
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.
-