Class ValueTypeRecipeLPElement
java.lang.Object
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeRecipeLPElement
- All Implemented Interfaces:
IGuiInputElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> ILogicProgrammerElement<ISubGuiBox,,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> IValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase>
Element for recipes.
This is hardcoded to only support items, fluids and energy
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeLPElementBase
ValueTypeLPElementBase.ValueTypeVariableFacadeFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionorg.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeRecipeLPElementMasterSubGuistatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Called when this element is activated.booleannet.minecraft.world.inventory.SlotcreateSlot(net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) Create a temporary input slot for this element.createSubGui(int baseX, int baseY, int maxWidth, int maxHeight, ContainerScreenLogicProgrammerBase gui, ContainerLogicProgrammerBase container) voidCalled when this element is deactivated.static net.minecraft.world.item.ItemStackgetFluidBucket(net.minecraftforge.fluids.FluidStack fluidStack) protected Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>, List<org.cyclops.commoncapabilities.api.capability.recipehandler.IPrototypedIngredientAlternatives<?, ?>>> getInputs(List<ItemMatchProperties> itemStacks, net.minecraft.world.item.ItemStack fluid, int fluidAmount, long energy) getInputsReusable(List<ItemMatchProperties> itemStacks) intgetOutputs(List<net.minecraft.world.item.ItemStack> itemStacksIn, net.minecraft.world.item.ItemStack fluid, int fluidAmount, long energy) static Optional<net.minecraft.world.item.ItemStack>getType()getValue()protected booleanbooleanisItemValidForSlot(int slotId, net.minecraft.world.item.ItemStack itemStack) Check if the given item can be inserted into the given slot.protected booleanbooleanisValidForRecipeGrid(List<ItemMatchProperties> itemInputs, List<net.minecraftforge.fluids.FluidStack> fluidInputs, List<net.minecraft.world.item.ItemStack> itemOutputs, List<net.minecraftforge.fluids.FluidStack> fluidOutputs) 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.protected voidputItemPropertiesInContainer(ContainerLogicProgrammerBase container, int slot, ItemMatchProperties props) protected voidputStackInContainer(ContainerLogicProgrammerBase container, int slot, net.minecraft.world.item.ItemStack itemStack) protected voidprotected voidprotected voidrefreshPropertiesGui(int slot) voidsendSlotPropertiesToServer(int slotId, ItemMatchProperties props) voidsetRecipeGrid(ContainerLogicProgrammerBase container, List<ItemMatchProperties> itemInputs, List<net.minecraftforge.fluids.FluidStack> fluidInputs, List<net.minecraft.world.item.ItemStack> itemOutputs, List<net.minecraftforge.fluids.FluidStack> fluidOutputs) voidvoidsetValueInContainer(ContainerLogicProgrammerBase container) Set the currently stored value in the given container.voidsetValueInGui(ISubGuiBox 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.static booleanslotClickCommon(int slotId, net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player, List<ItemMatchProperties> inputStacks, int propertySlotCount, Consumer<Integer> setPropertySubGui, Consumer<Integer> refreshPropertiesGui) 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, 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.IValueTypeLogicProgrammerElement
getValueType
-
Field Details
-
SLOT_OFFSET
public static final int SLOT_OFFSET- See Also:
-
TICK_DELAY
public static final int TICK_DELAY- See Also:
-
lastGui
public org.cyclops.integrateddynamics.core.logicprogrammer.ValueTypeRecipeLPElementMasterSubGui lastGui
-
-
Constructor Details
-
ValueTypeRecipeLPElement
public ValueTypeRecipeLPElement()
-
-
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.
-
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.
-
refreshPropertiesGui
protected void refreshPropertiesGui(int slot) -
refreshInputFluidAmountBox
protected void refreshInputFluidAmountBox() -
refreshOutputFluidAmountBox
protected void refreshOutputFluidAmountBox() -
sendSlotPropertiesToServer
-
isValidForRecipeGrid
public boolean isValidForRecipeGrid(List<ItemMatchProperties> itemInputs, List<net.minecraftforge.fluids.FluidStack> fluidInputs, List<net.minecraft.world.item.ItemStack> itemOutputs, List<net.minecraftforge.fluids.FluidStack> fluidOutputs) -
putItemPropertiesInContainer
protected void putItemPropertiesInContainer(ContainerLogicProgrammerBase container, int slot, ItemMatchProperties props) -
putStackInContainer
protected void putStackInContainer(ContainerLogicProgrammerBase container, int slot, net.minecraft.world.item.ItemStack itemStack) -
setRecipeGrid
public void setRecipeGrid(ContainerLogicProgrammerBase container, List<ItemMatchProperties> itemInputs, List<net.minecraftforge.fluids.FluidStack> fluidInputs, List<net.minecraft.world.item.ItemStack> itemOutputs, List<net.minecraftforge.fluids.FluidStack> fluidOutputs) -
getFluidBucket
public static net.minecraft.world.item.ItemStack getFluidBucket(net.minecraftforge.fluids.FluidStack fluidStack) -
isInputValid
protected boolean isInputValid() -
isOutputValid
protected boolean isOutputValid() -
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.
-
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<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
slotClickin classValueTypeLPElementBase- 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.
-
slotClickCommon
public static boolean slotClickCommon(int slotId, net.minecraft.world.inventory.Slot slot, int mouseButton, net.minecraft.world.inventory.ClickType clickType, net.minecraft.world.entity.player.Player player, List<ItemMatchProperties> inputStacks, int propertySlotCount, Consumer<Integer> setPropertySubGui, Consumer<Integer> refreshPropertiesGui) -
createSlot
public net.minecraft.world.inventory.Slot createSlot(net.minecraft.world.Container temporaryInputSlots, int slotId, int x, int y) Description copied from interface:ILogicProgrammerElementCreate 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.
-
getRotatingItemFromTag
public static Optional<net.minecraft.world.item.ItemStack> getRotatingItemFromTag(ItemMatchProperties props) -
getItemStackSizeLimit
public int getItemStackSizeLimit()- Specified by:
getItemStackSizeLimitin interfaceILogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
getItemStackSizeLimitin classValueTypeLPElementBase- Returns:
- The max stacksize.
-
getInputs
protected Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>, getInputsList<org.cyclops.commoncapabilities.api.capability.recipehandler.IPrototypedIngredientAlternatives<?, ?>>> (List<ItemMatchProperties> itemStacks, net.minecraft.world.item.ItemStack fluid, int fluidAmount, long energy) -
getInputsReusable
public static Map<org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<?,?>, getInputsReusableList<Boolean>> (List<ItemMatchProperties> itemStacks) -
getOutputs
-
getValue
- Returns:
- The current value.
-
setValue
- Specified by:
setValuein interfaceIValueTypeLogicProgrammerElement<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValuein classValueTypeLPElementBase- Parameters:
value- The new value.
-
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<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValueInGuiin classValueTypeLPElementBase- 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<ISubGuiBox,ContainerScreenLogicProgrammerBase, ContainerLogicProgrammerBase> - Overrides:
setValueInContainerin classValueTypeLPElementBase- Parameters:
container- The container to put the currently stored value in.
-
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.
-