Package alexiil.mc.lib.attributes.item
Class SingleCopyingItemSlot
java.lang.Object
alexiil.mc.lib.attributes.item.SingleItemSlotView
alexiil.mc.lib.attributes.item.SingleItemSlot
alexiil.mc.lib.attributes.item.SingleCopyingItemSlot
- All Implemented Interfaces:
- ItemExtractable,- ItemInsertable,- ItemTransferable,- LimitedConsumer<net.minecraft.item.ItemStack>,- Reference<net.minecraft.item.ItemStack>,- StackReference
- 
Method SummaryModifier and TypeMethodDescriptionaddListener(ItemInvSlotChangeListener listener, ListenerRemovalToken removalToken)Adds the given listener to the backing inventory, such that theItemInvSlotChangeListener.onChange(FixedItemInvView, int, ItemStack, ItemStack)will be called every time that this inventory changes.Methods inherited from class alexiil.mc.lib.attributes.item.SingleItemSlotattemptExtraction, attemptInsertion, forceSet, getInsertionFilter, modify, set, setMethods inherited from class alexiil.mc.lib.attributes.item.SingleItemSlotViewget, getFilter, getIndex, getMaxAmount, isValidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface alexiil.mc.lib.attributes.item.ItemExtractableattemptAnyExtraction, couldExtractAnything, extract, extract, extract, getPureExtractableMethods inherited from interface alexiil.mc.lib.attributes.item.ItemInsertablegetPureInsertable, insert, offer, offer, wouldAccept, wouldPartiallyAcceptMethods inherited from interface alexiil.mc.lib.attributes.item.ItemTransferablefilteredMethods inherited from interface alexiil.mc.lib.attributes.misc.ReferenceasDestroyable, get, isValid
- 
Method Details- 
getBackingInv- Overrides:
- getBackingInvin class- SingleItemSlot
 
- 
addListenerpublic final ListenerToken addListener(ItemInvSlotChangeListener listener, ListenerRemovalToken removalToken)Adds the given listener to the backing 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.- 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.
 
 
-