Interface ILogicProgrammerElement<S extends ISubGuiBox,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
- Type Parameters:
G
- The type of gui.C
- The type of container.S
- The sub gui box type.
- All Superinterfaces:
IGuiInputElement<S,
G, C>
- All Known Subinterfaces:
IValueTypeLogicProgrammerElement<S,
G, C>
- All Known Implementing Classes:
OperatorLPElement
,ValueTypeBooleanLPElement
,ValueTypeIngredientsLPElement
,ValueTypeItemStackLPElement
,ValueTypeListLPElement
,ValueTypeLPElementBase
,ValueTypeOperatorLPElement
,ValueTypeRecipeLPElement
,ValueTypeStringLPElement
public interface ILogicProgrammerElement<S extends ISubGuiBox,G extends net.minecraft.client.gui.screens.Screen,C extends net.minecraft.world.inventory.AbstractContainerMenu>
extends IGuiInputElement<S,G,C>
An element instantiation inside the logic programmer.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If this element in its current state can be deactivated because of another item being inserted into the write slot.boolean
default net.minecraft.world.inventory.Slot
createSlot
(net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) Create a temporary input slot for this element.static net.minecraft.world.inventory.Slot
createSlotDefault
(ILogicProgrammerElement logicProgrammerElement, net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) int
getType()
boolean
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.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
(S 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.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 interface org.cyclops.integrateddynamics.api.client.gui.subgui.IGuiInputElement
activate, createSubGui, deactivate, getColor, getName, getRenderPattern, getSymbol, loadTooltip, validate
-
Method Details
-
getType
ILogicProgrammerElementType getType()- Returns:
- The element type.
-
getMatchString
String getMatchString()- Returns:
- The string used to match regex searching.
-
matchesInput
If the given value type matches with this element's input.- Parameters:
valueType
- The value type to match.- Returns:
- If it matches
-
matchesOutput
If the given value type matches with this element's output.- Parameters:
valueType
- The value type to match.- Returns:
- If it matches
-
createSlot
default net.minecraft.world.inventory.Slot createSlot(net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) Create a temporary input slot for this element. The number of slots depends on the provided render pattern return byIGuiInputElement.getRenderPattern()
.- Parameters:
temporaryInputSlots
- The inventory behind this slot.slotId
- The slot id.x
- The X position for this slot.y
- The Y position for this slot.- Returns:
- The created slot.
-
createSlotDefault
static net.minecraft.world.inventory.Slot createSlotDefault(ILogicProgrammerElement logicProgrammerElement, net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) -
onInputSlotUpdated
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.- Parameters:
player
-slotId
- The slot id.itemStack
- The itemstack currently in the slot, can be null.
-
canWriteElementPre
boolean canWriteElementPre()- Returns:
- If this element can be written to an item in its current state.
-
writeElement
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.- Parameters:
player
- The player that is writing the element.itemStack
- The stack to write to.- Returns:
- The resulting itemstack.
-
canCurrentlyReadFromOtherItem
boolean canCurrentlyReadFromOtherItem()If this element in its current state can be deactivated because of another item being inserted into the write slot.- Returns:
- If this element can be deactivated.
-
isFor
- Parameters:
variableFacade
- A variable facade- Returns:
- If this element corresponds to the given variable facade.
-
isItemValidForSlot
boolean isItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.- Parameters:
slotId
- The slot id.itemStack
- The item that will be inserted.- Returns:
- If it can be inserted.
-
slotClick
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.- 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
int getItemStackSizeLimit()- Returns:
- The max stacksize.
-
isFocused
- Parameters:
subGui
- The corresponding sub gui of this element.- Returns:
- If this element has the active focus. For typing and things like that.
-
setFocused
Set the focus of this element.- Parameters:
subGui
- The corresponding sub gui of this element.focused
- If it must be focused.
-