Class MappedFixedItemInv
java.lang.Object
alexiil.mc.lib.attributes.item.impl.AbstractPartialFixedItemInvView
alexiil.mc.lib.attributes.item.impl.MappedFixedItemInvView
alexiil.mc.lib.attributes.item.impl.MappedFixedItemInv
- All Implemented Interfaces:
Convertible,AbstractItemInvView,FixedItemInv,FixedItemInvView
- Direct Known Subclasses:
MappedFixedItemInv.OfCopying,MappedFixedItemInv.OfModifiable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
AbstractItemInvView.DefaultChangeTrackerNested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
FixedItemInv.CopyingFixedItemInv, FixedItemInv.ModifiableFixedItemInv -
Field Summary
Fields inherited from class alexiil.mc.lib.attributes.item.impl.MappedFixedItemInvView
inverseSlotMap, slotsFields inherited from class alexiil.mc.lib.attributes.item.impl.AbstractPartialFixedItemInvView
inv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MappedFixedItemInvcreate(FixedItemInv inv, int[] slots) getMappedInv(int... slots) getSubInv(int fromIndex, int toIndex) Equivalent toList.subList(int, int).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.impl.MappedFixedItemInvView
createView, getInternalSlot, getSlotCountMethods inherited from class alexiil.mc.lib.attributes.item.impl.AbstractPartialFixedItemInvView
addListener, getChangeValue, getFilterForSlot, getInvStack, getMaxAmount, isItemValidForSlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
addListener, getChangeValueMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
createLimitedFixedInv, extractStack, forceSetInvStack, getExtractable, getGroupedInv, getInsertable, getInvStack, getSlot, getTransferable, insertStack, isItemValidForSlot, modifySlot, slotIterableMethods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvView
convertTo, getFilterForSlot, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
-
Constructor Details
-
MappedFixedItemInv
-
-
Method Details
-
setInvStack
Description copied from interface:FixedItemInvSets the stack in the given slot to the given stack.- Specified by:
setInvStackin interfaceFixedItemInvto- The newItemStack. It is not defined if you are allowed to modify this or not.- Returns:
- True if the modification was allowed, false otherwise. (For example if the given stack doesn't pass the
FixedItemInvView.isItemValidForSlot(int, ItemStack)test).
-
getSubInv
Description copied from interface:FixedItemInvViewEquivalent toList.subList(int, int).- Specified by:
getSubInvin interfaceFixedItemInv- Specified by:
getSubInvin interfaceFixedItemInvView- Overrides:
getSubInvin classMappedFixedItemInvView- Parameters:
fromIndex- The first slot to exposetoIndex- The slot after the last slot to expose.- Returns:
- a view of this inventory that only exposes the given number of slots. Might return "this" if fromIndex is
0 and toIndex is equal to
FixedItemInvView.getSlotCount().
-
getMappedInv
- Specified by:
getMappedInvin interfaceFixedItemInv- Specified by:
getMappedInvin interfaceFixedItemInvView- Overrides:
getMappedInvin classMappedFixedItemInvView- Parameters:
slots- The slots to expose.- Returns:
- a view of this inventory that only exposes the given slots. Might return "this" if the slot array is just
[0,1, ...
FixedItemInvView.getSlotCount()-1]
-
create
-