Package alexiil.mc.lib.attributes.item
Interface FixedItemInv.CopyingFixedItemInv
- All Superinterfaces:
- AbstractItemInvView,- Convertible,- FixedItemInv,- FixedItemInvView
- All Known Implementing Classes:
- CombinedFixedItemInv.OfCopying,- DelegatingFixedItemInv.OfCopying,- FullFixedItemInv,- MappedFixedItemInv.OfCopying,- SimpleFixedItemInv,- SimpleLimitedFixedItemInv.OfCopying,- SubFixedItemInv.OfCopying
- Enclosing interface:
- FixedItemInv
The "complex" variant of 
FixedItemInv that always returns copies of the stack held. As such this allows
 per-slot listeners to be registered, and full filter usage (as no-one can modify this inventory in a way that is
 not permitted).- 
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.FixedItemInvFixedItemInv.CopyingFixedItemInv, FixedItemInv.ModifiableFixedItemInv
- 
Method SummaryModifier and TypeMethodDescriptiondefault ListenerTokenaddListener(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()).default ListenerTokenaddListener(ItemInvSlotChangeListener listener, ListenerRemovalToken removalToken)Adds the given listener to this inventory, such that theItemInvSlotChangeListener.onChange(FixedItemInvView, int, ItemStack, ItemStack)will be called every time that this inventory changes.default net.minecraft.item.ItemStackgetInvStack(int slot)default SingleCopyingItemSlotgetSlot(int slot)net.minecraft.item.ItemStackgetUnmodifiableInvStack(int slot)Methods inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvViewgetChangeValueMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvcreateLimitedFixedInv, extractStack, forceSetInvStack, getExtractable, getGroupedInv, getInsertable, getMappedInv, getSubInv, getTransferable, insertStack, isItemValidForSlot, modifySlot, setInvStack, slotIterableMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvViewconvertTo, getFilterForSlot, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
- 
Method Details- 
getInvStackdefault net.minecraft.item.ItemStack getInvStack(int slot)- Specified by:
- getInvStackin interface- FixedItemInv
- Specified by:
- getInvStackin interface- FixedItemInvView
- Parameters:
- slot- The slot index. Must be a value between 0 (inclusive) and- FixedItemInvView.getSlotCount()(exclusive) to be valid. (Like in arrays, lists, etc).
- Returns:
- a copy of the ItemStackheld in this inventory.
 
- 
getUnmodifiableInvStacknet.minecraft.item.ItemStack getUnmodifiableInvStack(int slot)- Returns:
- The ItemStackthat is held by this inventory. Modifying the returnedItemStackin any way will (most likely - depending on the implementation) throw an exception (at some point).
 
- 
getSlot- Specified by:
- getSlotin interface- FixedItemInv
- Specified by:
- getSlotin interface- FixedItemInvView
- Returns:
- A view of a single slot in this inventory.
 
- 
addListenerdefault ListenerToken addListener(InvMarkDirtyListener listener, ListenerRemovalToken removalToken)Description 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
- 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.
 
- 
addListenerdefault ListenerToken addListener(ItemInvSlotChangeListener listener, ListenerRemovalToken removalToken)Adds the given listener to this inventory, such that theItemInvSlotChangeListener.onChange(FixedItemInvView, int, ItemStack, ItemStack)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! - Parameters:
- 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.
 
 
-