Package alexiil.mc.lib.attributes.item
Interface FixedItemInv.ModifiableFixedItemInv
- All Superinterfaces:
- AbstractItemInvView,- Convertible,- FixedItemInv,- FixedItemInvView
- All Known Implementing Classes:
- CombinedFixedItemInv.OfModifiable,- DelegatingFixedItemInv.OfModifiable,- DirectFixedItemInv,- EmptyFixedItemInv,- FixedInventoryVanillaWrapper,- FixedSidedInventoryVanillaWrapper,- MappedFixedItemInv.OfModifiable,- SimpleLimitedFixedItemInv.OfModifiable,- SubFixedItemInv.OfModifiable
- Enclosing interface:
- FixedItemInv
The "simpler" variant of 
FixedItemInv which allows callers to freely modify the current
 ItemStack contained in it's 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
- 
Method SummaryModifier and TypeMethodDescriptiondefault ItemFiltergetFilterForSlot(int slot)Note that this filter should only compare theItemcontained inItemStack's, because callers can always modify any other properties (like count or NBT) themselves.net.minecraft.item.ItemStackgetInvStack(int slot)booleanisItemValidForSlot(int slot, net.minecraft.item.ItemStack stack)Checks to see if the given stack is valid for a given slot.voidInforms this inventory that theItemStackreturned bygetInvStack(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 interface alexiil.mc.lib.attributes.item.AbstractItemInvViewaddListener, getChangeValueMethods 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.FixedItemInvViewconvertTo, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
- 
Method Details- 
getInvStacknet.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:
- The ItemStackthat is stored in thisFixedItemInv. Changing this will always change this inventory. As such you must always callmarkDirty()orsetInvStack(int, ItemStack, Simulation)after you have finished modifying it.
 
- 
isItemValidForSlotboolean isItemValidForSlot(int slot, net.minecraft.item.ItemStack stack)Checks to see if the given stack is valid for a given slot. This ignores any current stacks in the slot. Note that this should only compare theItemcontained inItemStack's, because callers can always modify any other properties (like count or NBT) themselves- Specified by:
- isItemValidForSlotin interface- FixedItemInv
- Specified by:
- isItemValidForSlotin 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).
- stack- The- ItemStackto check. It's undefined what is returned if an- emptystack is passed in, but it is not generally expected to be useful.
 
- 
getFilterForSlotNote that this filter should only compare theItemcontained inItemStack's, because callers can always modify any other properties (like count or NBT) themselves.- Specified by:
- getFilterForSlotin 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:
- An ItemFilterfor what may be present in this slot. If this slot is filtered by anItemFilterinternally then it is highly recommended that this be overridden to return that filter rather than the default opaque wrapper aroundFixedItemInvView.isItemValidForSlot(int, ItemStack).
 
- 
setInvStackDescription copied from interface:FixedItemInvSets the stack in the given slot to the given stack.- Specified by:
- setInvStackin interface- FixedItemInv
- Parameters:
- 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- 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).
 
- 
markDirtyvoid markDirty()Informs this inventory that theItemStackreturned bygetInvStack(int)has been changed.
 
-