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
Modifier and TypeClassDescriptionprotected static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Called when this element is activated.boolean
If this element in its current state can be deactivated because of another item being inserted into the write slot.boolean
createSubGui
(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) void
Called when this element is deactivated.int
getColor()
int
net.minecraft.network.chat.Component
getName()
getType()
protected int[]
getVariableIds
(IVariableFacade[] inputVariables) boolean
isFocused
(RenderPattern subGui) boolean
isFor
(IVariableFacade variableFacade) boolean
isItemValidForSlot
(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.void
loadTooltip
(List<net.minecraft.network.chat.Component> lines) boolean
matchesInput
(IValueType valueType) If the given value type matches with this element's input.boolean
matchesOutput
(IValueType valueType) If the given value type matches with this element's output.void
onInputSlotUpdated
(net.minecraft.world.entity.player.Player player, int slotId, net.minecraft.world.item.ItemStack itemStack) Called when an input item slot has been updated.void
setFocused
(RenderPattern subGui, boolean focused) Set the focus of this element.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) Called when a player clicks on a slot.net.minecraft.network.chat.Component
validate()
Validates the current state of the element.net.minecraft.world.item.ItemStack
writeElement
(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, wait
Methods inherited from interface org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement
createSlot
-
Constructor Details
-
OperatorLPElement
public OperatorLPElement()
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The element type.
-
getMatchString
- Specified by:
getMatchString
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The string used to match regex searching.
-
matchesInput
Description copied from interface:ILogicProgrammerElement
If the given value type matches with this element's input.- Specified by:
matchesInput
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
valueType
- The value type to match.- Returns:
- If it matches
-
matchesOutput
Description copied from interface:ILogicProgrammerElement
If the given value type matches with this element's output.- Specified by:
matchesOutput
in 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:
getName
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- Name used for rendering.
-
loadTooltip
- Specified by:
loadTooltip
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
lines
- The list to add tooltip lines to.
-
getRenderPattern
- Specified by:
getRenderPattern
in 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:ILogicProgrammerElement
Called when an input item slot has been updated.- Specified by:
onInputSlotUpdated
in 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:
canWriteElementPre
in 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:ILogicProgrammerElement
The stack to write the current state of this element to.- Specified by:
writeElement
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Parameters:
player
- The player that is writing the element.itemStack
- The stack to write to.- Returns:
- The resulting itemstack.
-
canCurrentlyReadFromOtherItem
public boolean canCurrentlyReadFromOtherItem()Description copied from interface:ILogicProgrammerElement
If this element in its current state can be deactivated because of another item being inserted into the write slot.- Specified by:
canCurrentlyReadFromOtherItem
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- If this element can be deactivated.
-
activate
public void activate()Description copied from interface:IGuiInputElement
Called when this element is activated.- Specified by:
activate
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
-
deactivate
public void deactivate()Description copied from interface:IGuiInputElement
Called when this element is deactivated.- Specified by:
deactivate
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
-
validate
public net.minecraft.network.chat.Component validate()Description copied from interface:IGuiInputElement
Validates the current state of the element.- Specified by:
validate
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- An error or null.
-
getColor
public int getColor()- Specified by:
getColor
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The color used to identify this element.
-
getSymbol
- Specified by:
getSymbol
in interfaceIGuiInputElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The symbol used to identify this element.
-
isFor
- Specified by:
isFor
in 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:ILogicProgrammerElement
Check if the given item can be inserted into the given slot.- Specified by:
isItemValidForSlot
in 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:ILogicProgrammerElement
Called when a player clicks on a slot.- Specified by:
slotClick
in 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:
getItemStackSizeLimit
in interfaceILogicProgrammerElement<RenderPattern,
ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Returns:
- The max stacksize.
-
isFocused
- Specified by:
isFocused
in 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:ILogicProgrammerElement
Set the focus of this element.- Specified by:
setFocused
in 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:
createSubGui
in 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.
-