Class ScrollingInventoryContainer<E>
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<E>
- All Implemented Interfaces:
org.cyclops.cyclopscore.client.gui.component.WidgetScrollBar.IScrollCallback,IContainerButtonClickAcceptorServer<ContainerExtended>,IValueNotifiable,IValueNotifier
@Deprecated
public abstract class ScrollingInventoryContainer<E>
extends InventoryContainer
implements org.cyclops.cyclopscore.client.gui.component.WidgetScrollBar.IScrollCallback
Deprecated.
An inventory container that has a scrollbar and searchfield.
Terminology:
row: The row index from visible elements.
elementIndex: The element index in all available elements
visible: Currently on-screen by the user, maximum amount of elements is determined by the pageSize
filtered: All items that are browsable by the user, might be more than the pageSize allows what leads to a scrollbar.
unfiltered: All items, pattern searching will happen in this list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.Predicate for matching items used to search. -
Field Summary
Fields 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, 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
ConstructorsConstructorDescriptionScrollingInventoryContainer(net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.Container inventory, List<E> items, ScrollingInventoryContainer.IItemPredicate<E> filterer) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanadditionalApplies(E item) Deprecated.An additional conditional that can be added for filtering items.protected voidenableElementAt(int visibleIndex, int elementIndex, E element) Deprecated.After scrolling, this will be called to make items visible.Deprecated.intDeprecated.intDeprecated.Deprecated.intDeprecated.abstract intDeprecated.intDeprecated.intDeprecated.Deprecated.getVisibleElement(int row) Deprecated.Get the currently visible element at the given row.booleanisElementVisible(int row) Deprecated.Check if the given element is visible.voidonScroll(int firstRow) Deprecated.voidDeprecated.voidupdateFilter(String searchString) Deprecated.Update the filtered items.Methods inherited from class org.cyclops.cyclopscore.inventory.container.InventoryContainer
getContainerInventory, getSizeInventory, isAssertInventorySize, removed, stillValidMethods inherited from class org.cyclops.cyclopscore.inventory.container.ContainerExtended
addInventory, addPlayerArmorInventory, addPlayerInventory, addSlot, addSlotListener, adjustPhantomSlot, broadcastChanges, clicked, 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, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clickMenuButton, createCarriedSlotAccess, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removeSlotListener, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Constructor Details
-
ScrollingInventoryContainer
public ScrollingInventoryContainer(@Nullable net.minecraft.world.inventory.MenuType<?> type, int id, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.world.Container inventory, List<E> items, ScrollingInventoryContainer.IItemPredicate<E> filterer) Deprecated.
-
-
Method Details
-
getUnfilteredItems
Deprecated. -
getFilteredItems
Deprecated. -
getUnfilteredItemCount
public int getUnfilteredItemCount()Deprecated. -
getFilteredItemCount
public int getFilteredItemCount()Deprecated. -
getFirstElement
public int getFirstElement()Deprecated. -
getColumns
public int getColumns()Deprecated.- Returns:
- The maximum amount of columns to show.
-
getScrollStepSize
public int getScrollStepSize()Deprecated.- Returns:
- The stepsize for scrolling.
-
onScroll
public void onScroll(int firstRow) Deprecated.- Specified by:
onScrollin interfaceorg.cyclops.cyclopscore.client.gui.component.WidgetScrollBar.IScrollCallback
-
getPageSize
public abstract int getPageSize()Deprecated.- Returns:
- The allowed page size.
-
enableElementAt
Deprecated.After scrolling, this will be called to make items visible.- Parameters:
visibleIndex- The visible item index.elementIndex- The absolute element index.element- The element to show.
-
isElementVisible
public boolean isElementVisible(int row) Deprecated.Check if the given element is visible.- Parameters:
row- The row the the given element is at.- Returns:
- If it is visible.
-
getVisibleElement
Deprecated.Get the currently visible element at the given row.- Parameters:
row- The row the the given element is at.- Returns:
- The elements
-
refreshFilter
public void refreshFilter()Deprecated. -
updateFilter
Deprecated.Update the filtered items.- Parameters:
searchString- The input string to search by.
-
filter
protected List<org.apache.commons.lang3.tuple.Pair<Integer,E>> filter(List<E> input, ScrollingInventoryContainer.IItemPredicate<E> predicate, Pattern pattern) Deprecated. -
additionalApplies
Deprecated.An additional conditional that can be added for filtering items.- Parameters:
item- The item to check.- Returns:
- If the item should be shown.
-