Class OperatorLPElement
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.OperatorLPElement
- All Implemented Interfaces:
IGuiInputElement<RenderPattern,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> ILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
public class OperatorLPElement
extends Object
implements ILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase,ContainerLogicProgrammerBase>
Element for operator.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Called when this element is activated.booleanIf this element in its current state can be deactivated because of another item being inserted into the write slot.booleancreateSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) voidCalled when this element is deactivated.intgetColor()intnet.minecraft.network.chat.ComponentgetName()getType()protected int[]getVariableIds(IVariableFacade[] inputVariables) booleanisFocused(RenderPattern subGui) booleanisFor(IVariableFacade variableFacade) booleanisItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.voidloadElement(IVariableFacade variableFacade) The variable facade to load onto this element.voidloadTooltip(List<net.minecraft.network.chat.Component> lines) booleanmatchesInput(IValueType valueType) If the given value type matches with this element's input.booleanmatchesOutput(IValueType valueType) If the given value type matches with this element's output.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.voidsetFocused(RenderPattern subGui, boolean focused) Set the focus of this element.voidsetValueInContainer(ContainerLogicProgrammerBase container) Set the currently stored value in the given container.voidsetValueInGui(RenderPattern subGui) Set the currently stored value in the given sub gui.booleanslotClick(int slotId, net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player) Called when a player clicks on a slot.net.minecraft.network.chat.Componentvalidate()Validates the current state of the element.net.minecraft.world.item.ItemStackwriteElement(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack) The stack to write the current state of this element to.Methods 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
createSlot
-
Constructor Details
-
OperatorLPElement
public OperatorLPElement()
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The element type.
-
getMatchString
- Specified by:
getMatchStringin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The string used to match regex searching.
-
matchesInput
Description copied from interface:ILogicProgrammerElementIf the given value type matches with this element's input.- Specified by:
matchesInputin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
valueType- The value type to match.- Returns:
- If it matches
-
matchesOutput
Description copied from interface:ILogicProgrammerElementIf the given value type matches with this element's output.- Specified by:
matchesOutputin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
valueType- The value type to match.- Returns:
- If it matches
-
getName
public net.minecraft.network.chat.Component getName()- Specified by:
getNamein interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- Name used for rendering.
-
loadTooltip
- Specified by:
loadTooltipin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
lines- The list to add tooltip lines to.
-
getRenderPattern
- Specified by:
getRenderPatternin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The render pattern.
-
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<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
player-slotId- The slot id.itemStack- The itemstack currently in the slot, can be null.
-
canWriteElementPre
public boolean canWriteElementPre()- Specified by:
canWriteElementPrein interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- If this element can be written to an item in its current state.
-
getVariableIds
-
writeElement
public net.minecraft.world.item.ItemStack writeElement(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack itemStack) Description copied from interface:ILogicProgrammerElementThe stack to write the current state of this element to.- Specified by:
writeElementin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
player- The player that is writing the element.itemStack- The stack to write to.- Returns:
- The resulting itemstack.
-
loadElement
Description copied from interface:ILogicProgrammerElementThe variable facade to load onto this element.- Specified by:
loadElementin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
variableFacade- The variable facade to load.
-
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<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - 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<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
container- The container to put the currently stored value in.
-
canCurrentlyReadFromOtherItem
public boolean canCurrentlyReadFromOtherItem()Description copied from interface:ILogicProgrammerElementIf this element in its current state can be deactivated because of another item being inserted into the write slot.- Specified by:
canCurrentlyReadFromOtherItemin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- If this element can be deactivated.
-
activate
public void activate()Description copied from interface:IGuiInputElementCalled when this element is activated.- Specified by:
activatein interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
-
deactivate
public void deactivate()Description copied from interface:IGuiInputElementCalled when this element is deactivated.- Specified by:
deactivatein interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
-
validate
public net.minecraft.network.chat.Component validate()Description copied from interface:IGuiInputElementValidates the current state of the element.- Specified by:
validatein interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- An error or null.
-
getColor
public int getColor()- Specified by:
getColorin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The color used to identify this element.
-
getSymbol
- Specified by:
getSymbolin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The symbol used to identify this element.
-
isFor
- Specified by:
isForin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
variableFacade- A variable facade- Returns:
- If this element corresponds to the given variable facade.
-
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<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
slotId- The slot id.itemStack- The item that will be inserted.- Returns:
- If it can be inserted.
-
slotClick
public boolean slotClick(int slotId, net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player) Description copied from interface:ILogicProgrammerElementCalled when a player clicks on a slot.- Specified by:
slotClickin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
slotId- The slot id.slot- The slot.mouseButton- The mouse buttong id.clickType- The click type.player- The clicking player.- Returns:
- If further processing of the clicking should stop.
-
getItemStackSizeLimit
public int getItemStackSizeLimit()- Specified by:
getItemStackSizeLimitin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The max stacksize.
-
isFocused
- Specified by:
isFocusedin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
subGui- The corresponding sub gui of this element.- Returns:
- If this element has the active focus. For typing and things like that.
-
setFocused
Description copied from interface:ILogicProgrammerElementSet the focus of this element.- Specified by:
setFocusedin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
subGui- The corresponding sub gui of this element.focused- If it must be focused.
-
createSubGui
public RenderPattern createSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) - Specified by:
createSubGuiin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
baseX- Base xbaseY- Base ymaxWidth- Max widthmaxHeight- Max heightgui- The parent guicontainer- The parent container- Returns:
- A subgui that is shown when activated.
-