Class AbstractGridContainerMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu
com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu
com.refinedmods.refinedstorage.common.grid.AbstractGridContainerMenu
- All Implemented Interfaces:
PreviewProvider,GridWatcher,CancelablePreviewProvider,GridExtractionStrategy,GridInsertionStrategy,GridScrollingStrategy,GridSortingTypes.TrackedResourceProvider,ScreenSizeListener
- Direct Known Subclasses:
AbstractCraftingGridContainerMenu,AbstractPortableGridContainerMenu,GridContainerMenu,PatternGridContainerMenu,WirelessGridContainerMenu
public abstract class AbstractGridContainerMenu
extends AbstractResourceContainerMenu
implements GridWatcher, GridInsertionStrategy, GridExtractionStrategy, GridScrollingStrategy, ScreenSizeListener, CancelablePreviewProvider, GridSortingTypes.TrackedResourceProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final net.minecraft.world.entity.player.InventoryFields inherited from class com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu
playerFields inherited from class com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu
disabledSlot, transferManagerFields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, Grid grid) protectedAbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, GridData gridData) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()protected booleancanTransferSlot(net.minecraft.world.inventory.Slot slot) getAutocraftableResourceHint(net.minecraft.world.inventory.Slot slot) getMaxAmount(ResourceKey resource, CancellationToken cancellationToken) getPreview(ResourceKey resource, long amount, CancellationToken cancellationToken) protected ResourceKeygetResourceForAutocraftableHint(net.minecraft.world.inventory.Slot slot) getTrackedResource(ResourceKey resource) getTrackedResource(GridResource resource) getTreePreview(ResourceKey resource, long amount, CancellationToken cancellationToken) voidUsually called when the grid network has been changed.booleanisActive()booleanisLargeSlot(net.minecraft.world.inventory.Slot slot) booleanvoidonActiveChanged(boolean newActive) Called when the activeness state of the grid has changed.voidonChanged(ResourceKey resource, long change, TrackedResource trackedResource) Called when a resource is changed.voidonClear()booleanonExtract(PlatformResourceKey resource, GridExtractMode extractMode, boolean cursor) booleanonInsert(GridInsertMode insertMode, boolean tryAlternatives) voidonResourceUpdate(ResourceKey resource, long amount, TrackedResource trackedResource) booleanonScroll(PlatformResourceKey resource, GridScrollMode scrollMode, int slotIndex) booleanonTransfer(int slotIndex) net.minecraft.world.item.ItemStackquickMoveStack(net.minecraft.world.entity.player.Player playerEntity, int slotIndex) voidremoved(net.minecraft.world.entity.player.Player playerEntity) voidresized(int playerInventoryY, int topYStart, int topYEnd) voidsetSearchBox(GridSearchBox searchBox) voidsetSortingDirection(SortingDirection sortingDirection) voidsetSortingType(GridSortingTypes sortingType) voidsetViewType(GridViewType viewType) startTask(ResourceKey resource, long amount, Actor actor, boolean notify, CancellationToken cancellationToken) booleanstillValid(net.minecraft.world.entity.player.Player player) voidvoidMethods inherited from class com.refinedmods.refinedstorage.common.support.containermenu.AbstractResourceContainerMenu
addSlot, addToResourceSlotIfNotExisting, areAllResourceSlotsEmpty, broadcastChanges, canTakeItemForPickAll, clicked, getResourceSlots, handleResourceFilterSlotUpdate, handleResourceSlotAmountChange, handleResourceSlotChange, handleResourceSlotUpdate, resetSlots, sendResourceSlotChangeMethods inherited from class com.refinedmods.refinedstorage.common.support.AbstractBaseContainerMenu
addPlayerInventory, addPlayerInventory, getProperty, handleFilterSlotChange, hasProperty, receivePropertyChangeFromClient, registerPropertyMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlotListener, broadcastFullState, canDragTo, canItemQuickReplace, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
playerInventory
protected final net.minecraft.world.entity.player.Inventory playerInventory
-
-
Constructor Details
-
AbstractGridContainerMenu
protected AbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, GridData gridData) -
AbstractGridContainerMenu
protected AbstractGridContainerMenu(net.minecraft.world.inventory.MenuType<? extends AbstractGridContainerMenu> menuType, int syncId, net.minecraft.world.entity.player.Inventory playerInventory, Grid grid)
-
-
Method Details
-
onResourceUpdate
public void onResourceUpdate(ResourceKey resource, long amount, @Nullable TrackedResource trackedResource) -
getTrackedResource
- Specified by:
getTrackedResourcein interfaceGridSortingTypes.TrackedResourceProvider
-
getTrackedResource
-
getSortingDirection
-
setSortingDirection
-
getSortingType
-
setSortingType
-
getViewType
-
setViewType
-
setSearchBox
-
removed
public void removed(net.minecraft.world.entity.player.Player playerEntity) - Overrides:
removedin classnet.minecraft.world.inventory.AbstractContainerMenu
-
resized
public void resized(int playerInventoryY, int topYStart, int topYEnd) - Specified by:
resizedin interfaceScreenSizeListener
-
getRepository
-
onActiveChanged
public void onActiveChanged(boolean newActive) Description copied from interface:GridWatcherCalled when the activeness state of the grid has changed.- Specified by:
onActiveChangedin interfaceGridWatcher- Parameters:
newActive- the new activeness state
-
onChanged
Description copied from interface:GridWatcherCalled when a resource is changed.- Specified by:
onChangedin interfaceGridWatcher- Parameters:
resource- the resourcechange- the changed amounttrackedResource- the tracked resource, if present
-
invalidate
public void invalidate()Description copied from interface:GridWatcherUsually called when the grid network has been changed.- Specified by:
invalidatein interfaceGridWatcher
-
isActive
public boolean isActive() -
getSynchronizer
-
getResourceType
-
toggleSynchronizer
public void toggleSynchronizer() -
toggleResourceType
public void toggleResourceType() -
onInsert
- Specified by:
onInsertin interfaceGridInsertionStrategy
-
onExtract
- Specified by:
onExtractin interfaceGridExtractionStrategy
-
onScroll
- Specified by:
onScrollin interfaceGridScrollingStrategy
-
onTransfer
public boolean onTransfer(int slotIndex) - Specified by:
onTransferin interfaceGridInsertionStrategy
-
quickMoveStack
public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player playerEntity, int slotIndex) - Overrides:
quickMoveStackin classAbstractBaseContainerMenu
-
canTransferSlot
protected boolean canTransferSlot(net.minecraft.world.inventory.Slot slot) -
onClear
public void onClear() -
getAutocraftableResourceHint
@Nullable public final AutocraftableResourceHint getAutocraftableResourceHint(net.minecraft.world.inventory.Slot slot) -
getResourceForAutocraftableHint
@Nullable protected ResourceKey getResourceForAutocraftableHint(net.minecraft.world.inventory.Slot slot) -
getPreview
public CompletableFuture<Optional<Preview>> getPreview(ResourceKey resource, long amount, CancellationToken cancellationToken) - Specified by:
getPreviewin interfacePreviewProvider
-
getTreePreview
public CompletableFuture<Optional<TreePreview>> getTreePreview(ResourceKey resource, long amount, CancellationToken cancellationToken) - Specified by:
getTreePreviewin interfacePreviewProvider
-
getMaxAmount
public CompletableFuture<Long> getMaxAmount(ResourceKey resource, CancellationToken cancellationToken) - Specified by:
getMaxAmountin interfacePreviewProvider
-
startTask
public Optional<TaskId> startTask(ResourceKey resource, long amount, Actor actor, boolean notify, CancellationToken cancellationToken) - Specified by:
startTaskin interfacePreviewProvider
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin classnet.minecraft.world.inventory.AbstractContainerMenu
-
cancel
public void cancel()- Specified by:
cancelin interfaceCancelablePreviewProvider
-
isLargeSlot
public boolean isLargeSlot(net.minecraft.world.inventory.Slot slot) -
isResourceTypeWarningVisible
public boolean isResourceTypeWarningVisible()
-