Class OperatorLPElement
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.OperatorLPElement
- All Implemented Interfaces:
IGuiInputElement<RenderPattern,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> ILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>>
public class OperatorLPElement
extends Object
implements ILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase,ContainerLogicProgrammerBase,OperatorLPElementClient<?>>
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.protected booleanbooleanvoidCalled when this element is deactivated.booleanintgetColor()intnet.minecraft.network.chat.ComponentgetName()getType()protected int[]getVariableIds(IVariableFacade[] inputVariables) inthashCode()booleanbooleanisFor(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(Consumer<net.minecraft.network.chat.Component> tooltipAdder) 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(boolean focused) voidsetInputVariables(IVariableFacade[] inputVariables) voidsetValueInContainer(ContainerLogicProgrammerBase container) Set the currently stored value in the given container.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.toString()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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement
createSlot
-
Constructor Details
-
OperatorLPElement
-
-
Method Details
-
getClient
- Specified by:
getClientin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>>
-
getType
- Specified by:
getTypein interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - Returns:
- The element type.
-
getMatchString
- Specified by:
getMatchStringin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - Returns:
- Name used for rendering.
-
loadTooltip
- Specified by:
loadTooltipin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - Parameters:
tooltipAdder- The list to add tooltip lines to.
-
getRenderPattern
- Specified by:
getRenderPatternin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - Parameters:
variableFacade- The variable facade to load.
-
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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>>
-
deactivate
public void deactivate()Description copied from interface:IGuiInputElementCalled when this element is deactivated.- Specified by:
deactivatein interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>>
-
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, OperatorLPElementClient<?>> - Returns:
- An error or null.
-
getColor
public int getColor()- Specified by:
getColorin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - Returns:
- The color used to identify this element.
-
getSymbol
- Specified by:
getSymbolin interfaceIGuiInputElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - Returns:
- The symbol used to identify this element.
-
isFor
- Specified by:
isForin interfaceILogicProgrammerElement<RenderPattern,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - 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, OperatorLPElementClient<?>> - Returns:
- The max stacksize.
-
getOperator
-
getInputVariables
-
setInputVariables
-
isFocused
public boolean isFocused() -
setFocused
public void setFocused(boolean focused) -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-