Class GroupedItemInvViewFixedWrapper
- All Implemented Interfaces:
- AbstractItemInvView,- GroupedItemInvView,- OpenWrapper
- Direct Known Subclasses:
- GroupedItemInvFixedWrapper
GroupedItemInvView that wraps a FixedItemInvView.- 
Nested Class SummaryNested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvViewAbstractItemInvView.DefaultChangeTrackerNested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.GroupedItemInvViewGroupedItemInvView.ItemInvStatistic
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddListener(InvMarkDirtyListener listener, ListenerRemovalToken removalToken)Adds the given listener to this inventory, such thatInvMarkDirtyListener.onMarkDirty(AbstractItemInvView)will be called every time that any stored stack is changed (either fromFixedItemInv.setInvStack(int, ItemStack, Simulation)orFixedItemInv.ModifiableFixedItemInv.markDirty()).addListener(ItemInvAmountChangeListener listener, ListenerRemovalToken removalToken)Adds the given listener to this inventory, such that theItemInvAmountChangeListener.onChange(GroupedItemInvView, ItemStack, int, int)will be called every time that this inventory changes.intgetStatistics(ItemFilter filter)Set<net.minecraft.item.ItemStack>intMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface alexiil.mc.lib.attributes.item.GroupedItemInvViewgetAmount, getAmount, getCapacity, getGroupedView, getSpace, getStatistics, isEmpty
- 
Constructor Details- 
GroupedItemInvViewFixedWrapper
 
- 
- 
Method Details- 
getStoredStacks- Specified by:
- getStoredStacksin interface- GroupedItemInvView
- Returns:
- a set containing all of the ItemStack's that are stored in the inventory. NOTE: This must return a set using one of theHash.Strategy's inItemStackCollectionsotherwise comparison methods won't work correctly!
 
- 
getTotalCapacitypublic int getTotalCapacity()- Specified by:
- getTotalCapacityin interface- GroupedItemInvView
- Returns:
- The total capacity for every ItemStackthat can be stored in this inventory.NOTE: This value might not be equal to the sum of GroupedItemInvView.getCapacity(ItemStack)overGroupedItemInvView.getStoredStacks()!
 
- 
getStatistics- Specified by:
- getStatisticsin interface- GroupedItemInvView
- Parameters:
- filter- The filter to check on.
- Returns:
- Statistics about the currently stored amount, capacity, and space for everything that matches the given filter.
 
- 
getChangeValuepublic int getChangeValue()- Specified by:
- getChangeValuein interface- AbstractItemInvView
- Returns:
- A value that indicates whether an inventory might have changed if it differs from the last value
         returned. This number doesn't have to start at 0, but it must change every time that the inventory is
         changed, although it can change even without any observable changes to this inventory.
         Inventories that don't support this might increment the change number every time that this is called - so you should never write a loop that depends on the returned value settling down on a particular value. Inventories that support listenershighly encouraged to support this - by definition if an inventory knows when it changed then it should be able to count the number of changes. It is also implied that any changes to this value will also invoke every registeredInvMarkDirtyListener.The default implementation returns an ever-increasing value. 
 
- 
addListenerDescription copied from interface:AbstractItemInvViewAdds the given listener to this inventory, such thatInvMarkDirtyListener.onMarkDirty(AbstractItemInvView)will be called every time that any stored stack is changed (either fromFixedItemInv.setInvStack(int, ItemStack, Simulation)orFixedItemInv.ModifiableFixedItemInv.markDirty()).If the listener is registered (and thus this returns null) then it implies that AbstractItemInvView.getChangeValue()will change every time that the given listener is invoked, always just-before it is invoked.The default implementation refuses to accept any listeners, but implementations are highly encouraged to override this if they are able to! - Specified by:
- addListenerin interface- AbstractItemInvView
- Specified by:
- addListenerin interface- GroupedItemInvView
- removalToken- A token that will be called whenever the given listener is removed from this inventory (or if this inventory itself is unloaded or otherwise invalidated).
- Returns:
- A token that represents the listener, or null if the listener could not be added.
 
- 
addListenerpublic ListenerToken addListener(ItemInvAmountChangeListener listener, ListenerRemovalToken removalToken)Description copied from interface:GroupedItemInvViewAdds the given listener to this inventory, such that theItemInvAmountChangeListener.onChange(GroupedItemInvView, ItemStack, int, int)will be called every time that this inventory changes. However if this inventory doesn't support listeners then this will return a nulltoken.The default implementation refuses to accept any listeners, but implementations are highly encouraged to override this if they are able to! - Specified by:
- addListenerin interface- GroupedItemInvView
- removalToken- A token that will be called whenever the given listener is removed from this inventory (or if this inventory itself is unloaded or otherwise invalidated).
- Returns:
- A token that represents the listener, or null if the listener could not be added.
 
- 
getWrapped- Specified by:
- getWrappedin interface- OpenWrapper
- Returns:
- The object that this wraps, or null if the wrapped object cannot be converted cleanly without exposing
         additional details.
         For example LBA's InventorytoFixedItemInvViewwrapper (FixedInventoryViewVanillaWrapper) implements this to return theInventory, but theSidedInventoryvariant (FixedSidedInventoryVanillaWrapper) returns null, as it is not possible to cleanly open the original inventory without exposing additional slots.
 
 
-