Enum Class EmptyFixedItemInv
- All Implemented Interfaces:
- Convertible,- AbstractItemInvView,- FixedItemInv,- FixedItemInv.ModifiableFixedItemInv,- FixedItemInvView,- NullVariant,- Serializable,- Comparable<EmptyFixedItemInv>,- Constable
FixedItemInv with no slots. Because this inventory is unmodifiable this also doubles as the empty
 implementation for FixedItemInvView.- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>Nested 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
- 
Enum Constant SummaryEnum Constants
- 
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()).intgetFilterForSlot(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)intgetMaxAmount(int slot, net.minecraft.item.ItemStack stack)intbooleanisItemValidForSlot(int slot, net.minecraft.item.ItemStack item)Checks to see if the given stack is valid for a given slot.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.toString()static EmptyFixedItemInvReturns the enum constant of this class with the specified name.static EmptyFixedItemInv[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enumclone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvcreateLimitedFixedInv, extractStack, forceSetInvStack, getMappedInv, getSlot, getSubInv, insertStack, modifySlot, slotIterableMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvViewconvertTo, offerSelfAsAttribute, stackIterable
- 
Enum Constant Details- 
INSTANCE
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
getSlotCountpublic int getSlotCount()- Specified by:
- getSlotCountin interface- FixedItemInvView
- Returns:
- The number of slots in this inventory.
 
- 
getInvStackpublic net.minecraft.item.ItemStack getInvStack(int slot)- Specified by:
- getInvStackin interface- FixedItemInv
- Specified by:
- getInvStackin interface- FixedItemInv.ModifiableFixedItemInv
- 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 callFixedItemInv.ModifiableFixedItemInv.markDirty()orFixedItemInv.ModifiableFixedItemInv.setInvStack(int, ItemStack, Simulation)after you have finished modifying it.
 
- 
isItemValidForSlotpublic boolean isItemValidForSlot(int slot, net.minecraft.item.ItemStack item)Description copied from interface:FixedItemInv.ModifiableFixedItemInvChecks 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- FixedItemInv.ModifiableFixedItemInv
- 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).
- item- The- ItemStackto check. It's undefined what is returned if an- emptystack is passed in, but it is not generally expected to be useful.
 
- 
getFilterForSlotDescription copied from interface:FixedItemInv.ModifiableFixedItemInvNote 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- FixedItemInv.ModifiableFixedItemInv
- 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).
 
- 
getMaxAmountpublic int getMaxAmount(int slot, net.minecraft.item.ItemStack stack)- Specified by:
- getMaxAmountin 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 stack to check for. May be an- emptystack to get the maximum amount that this can hold of any stack.
- Returns:
- The maximum amount that the given slot can hold of the given stack. This method will ignore the current
         stack in FixedItemInvView.getInvStack(int). The default implementation just delegates toItemStack.getMaxCount(). Note that any setters that this object implements (likeFixedItemInv.setInvStack(int, ItemStack, Simulation)should reject stacks that are greater than this value. (and callers should only call this if they need to check the amounts separately. Note that it is meaningless to return values greater than the maximum amount an item can be stacked to here, and callers are free to throw an exception if this is violated. (Basically huge single-slot inventories shouldn't implement this interface).
 
- 
getChangeValuepublic int getChangeValue()- Specified by:
- getChangeValuein interface- AbstractItemInvView
- Returns:
- A value that indicates whether an inventory might have changed if it differs from the last value
         returned. This number doesn't have to start at 0, but it must change every time that the inventory is
         changed, although it can change even without any observable changes to this inventory.
         Inventories that don't support this might increment the change number every time that this is called - so you should never write a loop that depends on the returned value settling down on a particular value. Inventories that support listenershighly encouraged to support this - by definition if an inventory knows when it changed then it should be able to count the number of changes. It is also implied that any changes to this value will also invoke every registeredInvMarkDirtyListener.The default implementation returns an ever-increasing value. 
 
- 
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.
 
- 
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).
 
- 
getFixedView- Specified by:
- getFixedViewin interface- FixedItemInvView
- Returns:
- An object that only implements FixedItemInvView, and does not expose the modification methods thatFixedItemInvdoes. Implementations that don't expose any modification methods themselves should override this method to just return themselves.
 
- 
getGroupedInv- Specified by:
- getGroupedInvin interface- FixedItemInv
- Specified by:
- getGroupedInvin interface- FixedItemInvView
- Returns:
- A GroupedItemInvfor this inventory. The returned value must always be valid for the lifetime of thisFixedItemInvobject. (In other words it must always be valid to cache this returned value and use it alongside a cached instance of this object).
 
- 
getTransferable- Specified by:
- getTransferablein interface- FixedItemInv
- Returns:
- An ItemTransferablefor this inventory. The default implementation delegates toFixedItemInv.getGroupedInv().
 
- 
getInsertable- Specified by:
- getInsertablein interface- FixedItemInv
- Returns:
- An ItemInsertablefor this inventory that will attempt to insert into any of the slots in this inventory. The default implementation delegates toFixedItemInv.getGroupedInv().
 
- 
getExtractable- Specified by:
- getExtractablein interface- FixedItemInv
- Returns:
- An ItemExtractablefor this inventory that will attempt to extract from any of the slots in this inventory. The default implementation delegates toFixedItemInv.getGroupedInv().
 
- 
toString- Overrides:
- toStringin class- Enum<EmptyFixedItemInv>
 
 
-