Class SimpleLimitedFixedItemInv.OfModifiable
java.lang.Object
alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv
alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv
alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv.OfModifiable
- All Implemented Interfaces:
Convertible
,AbstractItemInvView
,FixedItemInv
,FixedItemInv.ModifiableFixedItemInv
,FixedItemInvView
,LimitedFixedItemInv
- Enclosing class:
- SimpleLimitedFixedItemInv
public static class SimpleLimitedFixedItemInv.OfModifiable
extends SimpleLimitedFixedItemInv
implements FixedItemInv.ModifiableFixedItemInv
-
Nested Class Summary
Nested classes/interfaces inherited from class alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv
SimpleLimitedFixedItemInv.OfCopying, SimpleLimitedFixedItemInv.OfModifiable
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
AbstractItemInvView.DefaultChangeTracker
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
FixedItemInv.CopyingFixedItemInv, FixedItemInv.ModifiableFixedItemInv
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.LimitedFixedItemInv
LimitedFixedItemInv.ItemSlotLimitRule
-
Field Summary
Fields inherited from class alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv
extractionFilters, insertionFilters, maxInsertionAmounts, minimumAmounts
Fields inherited from class alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv
delegate
-
Constructor Summary
-
Method Summary
Modifier 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()
).void
Informs this inventory that theItemStack
returned byFixedItemInv.ModifiableFixedItemInv.getInvStack(int)
has been changed.Methods inherited from class alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv
assertMutable, copy, createLimited, extractStack, getFilterForSlot, getMaxAmount, getRule, getSubRule, insertStack, isItemValidForSlot, markFinal, setInvStack
Methods inherited from class alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv
createDelegate, getChangeValue, getInvStack, getSlotCount
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
getChangeValue
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
createLimitedFixedInv, extractStack, forceSetInvStack, getExtractable, getGroupedInv, getInsertable, getMappedInv, getSlot, getSubInv, getTransferable, insertStack, modifySlot, slotIterable
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv.ModifiableFixedItemInv
getFilterForSlot, getInvStack, isItemValidForSlot, setInvStack
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvView
convertTo, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
Methods inherited from interface alexiil.mc.lib.attributes.item.LimitedFixedItemInv
asUnmodifiable, getAllRule, reset
-
Constructor Details
-
OfModifiable
-
-
Method Details
-
markDirty
public void markDirty()Description copied from interface:FixedItemInv.ModifiableFixedItemInv
Informs this inventory that theItemStack
returned byFixedItemInv.ModifiableFixedItemInv.getInvStack(int)
has been changed.- Specified by:
markDirty
in interfaceFixedItemInv.ModifiableFixedItemInv
-
addListener
Description copied from interface:AbstractItemInvView
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()
).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:
addListener
in interfaceAbstractItemInvView
- Overrides:
addListener
in classDelegatingFixedItemInv
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.
-