Class SimpleLimitedFixedItemInv.OfCopying
java.lang.Object
alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv
alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv
alexiil.mc.lib.attributes.item.impl.SimpleLimitedFixedItemInv.OfCopying
- All Implemented Interfaces:
Convertible
,AbstractItemInvView
,FixedItemInv
,FixedItemInv.CopyingFixedItemInv
,FixedItemInvView
,LimitedFixedItemInv
- Enclosing class:
- SimpleLimitedFixedItemInv
public static class SimpleLimitedFixedItemInv.OfCopying
extends SimpleLimitedFixedItemInv
implements FixedItemInv.CopyingFixedItemInv
-
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(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.net.minecraft.item.ItemStack
getUnmodifiableInvStack(int slot)
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
addListener, 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, getSubInv, getTransferable, insertStack, isItemValidForSlot, modifySlot, setInvStack, slotIterable
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv.CopyingFixedItemInv
addListener, getInvStack, getSlot
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvView
convertTo, getFilterForSlot, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
Methods inherited from interface alexiil.mc.lib.attributes.item.LimitedFixedItemInv
asUnmodifiable, getAllRule, reset
-
Constructor Details
-
OfCopying
-
-
Method Details
-
getUnmodifiableInvStack
public net.minecraft.item.ItemStack getUnmodifiableInvStack(int slot)- Specified by:
getUnmodifiableInvStack
in interfaceFixedItemInv.CopyingFixedItemInv
- Returns:
- The
ItemStack
that is held by this inventory. Modifying the returnedItemStack
in any way will (most likely - depending on the implementation) throw an exception (at some point).
-
addListener
public ListenerToken addListener(ItemInvSlotChangeListener listener, ListenerRemovalToken removalToken)Description copied from interface:FixedItemInv.CopyingFixedItemInv
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!
- Specified by:
addListener
in interfaceFixedItemInv.CopyingFixedItemInv
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.
-