Class ContainerLogicProgrammerBase
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
org.cyclops.cyclopscore.inventory.container.ContainerExtended
org.cyclops.cyclopscore.inventory.container.InventoryContainer
org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>>
org.cyclops.integrateddynamics.inventory.container.ContainerLogicProgrammerBase
- All Implemented Interfaces:
org.cyclops.cyclopscore.client.gui.component.WidgetScrollBar.IScrollCallback, org.cyclops.cyclopscore.inventory.container.button.IContainerButtonClickAcceptorServer<org.cyclops.cyclopscore.inventory.container.ContainerExtended>, org.cyclops.cyclopscore.inventory.IValueNotifiable, org.cyclops.cyclopscore.inventory.IValueNotifier, org.cyclops.cyclopscore.persist.IDirtyMarkListener
- Direct Known Subclasses:
ContainerLogicProgrammer, ContainerLogicProgrammerPortable
public abstract class ContainerLogicProgrammerBase
extends org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>>
implements org.cyclops.cyclopscore.persist.IDirtyMarkListener
Base container for the logic programmer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classFilter LP elements based on the filter value types.protected classLoad existing operator data when a variable card is inserted into the write slotstatic interfaceNested classes/interfaces inherited from class org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer
org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer.IItemPredicate<E> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intThe expression side panel, to the right of the main panel.static final intprotected static final org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer.IItemPredicate<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>> static final intstatic final intstatic final intstatic final intFields inherited from class org.cyclops.cyclopscore.inventory.container.InventoryContainer
inventoryFields inherited from class org.cyclops.cyclopscore.inventory.container.ContainerExtended
ITEMBOX, offsetX, offsetY, playerFields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, CONTAINER_CLICK_PRIMARY, CONTAINER_CLICK_SECONDARY, containerId, lastSlots, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, remoteSlots, SLOT_CLICKED_OUTSIDE, SLOT_SIZE, slots, SLOTS_PER_ROW -
Constructor Summary
ConstructorsConstructorDescriptionContainerLogicProgrammerBase(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory playerInventory) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanvoidapplyExpressionAction(net.minecraft.nbt.CompoundTag action) Apply an expression edit action to the active element.protected voidapplySetExpressionAction(net.minecraft.nbt.CompoundTag action) Replace the whole expression of the active element.booleanbooleanvoidclicked(int slotId, int mouseButton, net.minecraft.world.inventory.ContainerInput clickType, net.minecraft.world.entity.player.Player player) ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?> protected static List<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>> getGui()net.minecraft.network.chat.ComponentgetOperatorElement(IOperator operator) intprotected intorg.cyclops.cyclopscore.inventory.SimpleInventorybooleanprotected voidprotected voidprotected booleanbooleanisWriteSlot(net.minecraft.world.inventory.Slot slot) protected voidprotected voidloadConfigFrom(net.minecraft.world.item.ItemStack itemStack) voidonDirty()voidonLabelPacket(String label) voidrefreshElementInventory(ILogicProgrammerElement element, int baseX, int baseY) Recreate the slots of the given element, for example when the element changes its render pattern.voidremoved(net.minecraft.world.entity.player.Player player) voidvoidsetActiveElement(ILogicProgrammerElement activeElement, int baseX, int baseY) Set the new active element.voidsetActiveElementById(net.minecraft.resources.Identifier typeId, net.minecraft.resources.Identifier elementId) voidsetElementInventory(ILogicProgrammerElement element, int baseX, int baseY) Set the new active element.voidOnly show operators whose output fits the given type, used while an expression slot is selected.voidsetScreenCallbackHandler(ContainerLogicProgrammerBase.ScreenCallbackHandler screenCallbackHandler) protected net.minecraft.world.item.ItemStackMethods inherited from class org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer
enableElementAt, filter, getColumns, getFilteredItemCount, getFilteredItems, getFirstElement, getScrollStepSize, getUnfilteredItemCount, getUnfilteredItems, getVisibleElement, isElementVisible, onScroll, refreshFilter, updateFilterMethods inherited from class org.cyclops.cyclopscore.inventory.container.InventoryContainer
getContainerInventory, stillValidMethods inherited from class org.cyclops.cyclopscore.inventory.container.ContainerExtended
addInventory, addPlayerArmorInventory, addPlayerInventory, addSlot, addSlotListener, adjustPhantomSlot, broadcastChanges, createNewSlot, fillPhantomSlot, getHolderLookupProvider, getNextValueId, getPlayerIInventory, getSlotRange, getSlotStart, getValue, getValueIds, getValueNotifiableType, initializeValues, moveItemStackTo, onButtonClick, onUpdate, putButtonAction, quickMoveStack, registerSyncedVariable, resetQuickCraft, setGuiValueListener, setSlotPosX, setSlotPosY, setValueMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addInventoryExtendedSlots, addInventoryHotbarSlots, addStandardInventorySlots, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removeSlotListener, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotUnsafe, setSelectedBundleItemIndex, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
OUTPUT_X
public static final int OUTPUT_X- See Also:
-
OUTPUT_Y
public static final int OUTPUT_Y- See Also:
-
BASE_X
public static final int BASE_X- See Also:
-
BASE_Y
public static final int BASE_Y- See Also:
-
MAX_WIDTH
public static final int MAX_WIDTH- See Also:
-
MAX_HEIGHT
public static final int MAX_HEIGHT- See Also:
-
EXPRESSION_PANEL_X
public static final int EXPRESSION_PANEL_XThe expression side panel, to the right of the main panel.- See Also:
-
EXPRESSION_PANEL_Y
public static final int EXPRESSION_PANEL_Y- See Also:
-
EXPRESSION_PANEL_WIDTH
public static final int EXPRESSION_PANEL_WIDTH- See Also:
-
EXPRESSION_PANEL_HEIGHT
public static final int EXPRESSION_PANEL_HEIGHT- See Also:
-
FILTERER
protected static final org.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer.IItemPredicate<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>> FILTERER
-
-
Constructor Details
-
ContainerLogicProgrammerBase
public ContainerLogicProgrammerBase(@Nullable net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory playerInventory)
-
-
Method Details
-
getElements
protected static List<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>> getElements() -
setScreenCallbackHandler
public void setScreenCallbackHandler(ContainerLogicProgrammerBase.ScreenCallbackHandler screenCallbackHandler) -
getGui
-
initializeSlotsPre
protected void initializeSlotsPre() -
initializeSlotsPost
protected void initializeSlotsPost() -
getPageSize
public int getPageSize()- Specified by:
getPageSizein classorg.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>>
-
isAssertInventorySize
protected boolean isAssertInventorySize()- Overrides:
isAssertInventorySizein classorg.cyclops.cyclopscore.inventory.container.InventoryContainer
-
getSizeInventory
protected int getSizeInventory()- Overrides:
getSizeInventoryin classorg.cyclops.cyclopscore.inventory.container.InventoryContainer
-
setActiveElementById
public void setActiveElementById(net.minecraft.resources.Identifier typeId, net.minecraft.resources.Identifier elementId) -
setActiveElement
Set the new active element.- Parameters:
activeElement- The new element.baseX- The slots X coordinatebaseY- The slots Y coordinate
-
setElementInventory
Set the new active element.- Parameters:
element- The new element.baseX- The slots X coordinatebaseY- The slots Y coordinate
-
refreshElementInventory
Recreate the slots of the given element, for example when the element changes its render pattern. In contrast tosetElementInventory(ILogicProgrammerElement, int, int), this keeps the current label.- Parameters:
element- The element.baseX- The slots X coordinatebaseY- The slots Y coordinate
-
applyExpressionAction
public void applyExpressionAction(net.minecraft.nbt.CompoundTag action) Apply an expression edit action to the active element. This is called on the server via a packet, and directly on the client.- Parameters:
action- The action.
-
getExpressionHistory
- Returns:
- The changes to the expression in the active element, which are only recorded on the client.
-
getOperatorElement
- Parameters:
operator- An operator.- Returns:
- The element for building expressions with this operator as root, or null if there is none.
-
applySetExpressionAction
protected void applySetExpressionAction(net.minecraft.nbt.CompoundTag action) Replace the whole expression of the active element. If the root operator changes, the element of that operator becomes active, as when loading a card. This also happens if no operator element is active, such as for an expression that was typed in the empty panel.- Parameters:
action- A set action.
-
canWriteActiveElementPre
public boolean canWriteActiveElementPre() -
canWriteActiveElement
public boolean canWriteActiveElement() -
getActiveElement
public ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?> getActiveElement() -
getTemporarySlotsElement
- Returns:
- The element owning the current temporary input slots. This differs from the active element for nested elements, such as list entries.
-
removed
public void removed(net.minecraft.world.entity.player.Player player) - Overrides:
removedin classorg.cyclops.cyclopscore.inventory.container.InventoryContainer
-
onLabelPacket
-
labelCurrent
protected void labelCurrent() -
writeElementInfo
protected net.minecraft.world.item.ItemStack writeElementInfo() -
onDirty
public void onDirty()- Specified by:
onDirtyin interfaceorg.cyclops.cyclopscore.persist.IDirtyMarkListener
-
loadConfigFrom
protected void loadConfigFrom(net.minecraft.world.item.ItemStack itemStack) -
getLastError
public net.minecraft.network.chat.Component getLastError() -
getTemporaryInputSlots
public org.cyclops.cyclopscore.inventory.SimpleInventory getTemporaryInputSlots() -
hasWriteItemInSlot
public boolean hasWriteItemInSlot() -
isWriteSlot
public boolean isWriteSlot(net.minecraft.world.inventory.Slot slot) - Parameters:
slot- A slot of this container.- Returns:
- If it is the slot that cards are written in.
-
returnWriteItemToPlayer
public void returnWriteItemToPlayer() -
setExpressionSlotFilter
Only show operators whose output fits the given type, used while an expression slot is selected. For operator slots, all operators are shown.- Parameters:
type- The expected type, or null to disable this filter.
-
additionalApplies
- Overrides:
additionalAppliesin classorg.cyclops.cyclopscore.inventory.container.ScrollingInventoryContainer<ILogicProgrammerElement<RenderPattern, ContainerScreenLogicProgrammerBase<?>, ContainerLogicProgrammerBase, ?>>
-
clicked
public void clicked(int slotId, int mouseButton, net.minecraft.world.inventory.ContainerInput clickType, net.minecraft.world.entity.player.Player player) - Overrides:
clickedin classorg.cyclops.cyclopscore.inventory.container.ContainerExtended
-