Class FixedInventoryVanillaWrapper
java.lang.Object
alexiil.mc.lib.attributes.item.compat.FixedInventoryViewVanillaWrapper
alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper
- All Implemented Interfaces:
- Convertible,- AbstractItemInvView,- FixedItemInv,- FixedItemInv.ModifiableFixedItemInv,- FixedItemInvView,- OpenWrapper
- Direct Known Subclasses:
- FixedSidedInventoryVanillaWrapper
public class FixedInventoryVanillaWrapper
extends FixedInventoryViewVanillaWrapper
implements FixedItemInv.ModifiableFixedItemInv
An 
FixedItemInv that wraps a vanilla Inventory.- 
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
- 
Field SummaryFields inherited from class alexiil.mc.lib.attributes.item.compat.FixedInventoryViewVanillaWrapperinv
- 
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()).protected booleancanExtract(int slot, net.minecraft.item.ItemStack extractedStack)protected booleancanInsert(int slot, net.minecraft.item.ItemStack newStack)voidInforms this inventory that theItemStackreturned byFixedItemInv.ModifiableFixedItemInv.getInvStack(int)has been changed.booleansetInvStack(int slot, net.minecraft.item.ItemStack to, Simulation simulation)Sets the stack in the given slot to the given stack.Methods inherited from class alexiil.mc.lib.attributes.item.compat.FixedInventoryViewVanillaWrappergetInvStack, getMaxAmount, getSlotCount, getWrapped, isItemValidForSlot, wrapInventoryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvViewgetChangeValueMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvcreateLimitedFixedInv, extractStack, forceSetInvStack, getExtractable, getGroupedInv, getInsertable, getMappedInv, getSlot, getSubInv, getTransferable, insertStack, modifySlot, slotIterableMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv.ModifiableFixedItemInvgetFilterForSlot, getInvStack, isItemValidForSlotMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvViewconvertTo, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
- 
Constructor Details- 
FixedInventoryVanillaWrapperpublic FixedInventoryVanillaWrapper(net.minecraft.inventory.Inventory inv)
 
- 
- 
Method Details- 
setInvStackDescription copied from interface:FixedItemInvSets the stack in the given slot to the given stack.- Specified by:
- setInvStackin interface- FixedItemInv
- Specified by:
- setInvStackin interface- FixedItemInv.ModifiableFixedItemInv
- to- The new stack to set this to. If this is identically equal (with ==) to the stack held in this inventory (so it was returned by- FixedItemInv.ModifiableFixedItemInv.getInvStack(int)) then this will return true.
- Returns:
- True if the modification was allowed, false otherwise. (For example if the given stack doesn't pass the
         FixedItemInvView.isItemValidForSlot(int, ItemStack)test).
 
- 
canExtractprotected boolean canExtract(int slot, net.minecraft.item.ItemStack extractedStack)
- 
canInsertprotected boolean canInsert(int slot, net.minecraft.item.ItemStack newStack)
- 
markDirtypublic void markDirty()Description copied from interface:FixedItemInv.ModifiableFixedItemInvInforms this inventory that theItemStackreturned byFixedItemInv.ModifiableFixedItemInv.getInvStack(int)has been changed.- Specified by:
- markDirtyin interface- FixedItemInv.ModifiableFixedItemInv
 
- 
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
- 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.
 
 
-