Package alexiil.mc.lib.attributes.item
Interface LimitedFixedItemInv
- All Superinterfaces:
AbstractItemInvView
,Convertible
,FixedItemInv
,FixedItemInvView
- All Known Implementing Classes:
SimpleLimitedFixedItemInv
,SimpleLimitedFixedItemInv.OfCopying
,SimpleLimitedFixedItemInv.OfModifiable
A type of
FixedItemInv
that wraps an existing FixedItemInv
and provides custom control over the
actual modification of the wrapped FixedItemInv
.
Note that it is never possible to get the wrapped FixedItemInv
from this class.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A rule for a set of slots.Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
AbstractItemInvView.DefaultChangeTracker
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
FixedItemInv.CopyingFixedItemInv, FixedItemInv.ModifiableFixedItemInv
-
Method Summary
Modifier and TypeMethodDescriptiondefault FixedItemInv
copy()
Creates a copy of thisLimitedFixedItemInv
(with the same backing inventory and the same rules).getRule(int slot)
getSubRule(int from, int to)
Marks this object as final, and disallows any further changes to this.default LimitedFixedItemInv
reset()
Completely clears all rules currently imposed.Methods inherited from interface alexiil.mc.lib.attributes.item.AbstractItemInvView
addListener, getChangeValue
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInv
createLimitedFixedInv, extractStack, forceSetInvStack, getExtractable, getGroupedInv, getInsertable, getInvStack, getMappedInv, getSlot, getSubInv, getTransferable, insertStack, isItemValidForSlot, modifySlot, setInvStack, slotIterable
Methods inherited from interface alexiil.mc.lib.attributes.item.FixedItemInvView
convertTo, getFilterForSlot, getFixedView, getMaxAmount, getSlotCount, offerSelfAsAttribute, stackIterable
-
Method Details
-
markFinal
LimitedFixedItemInv markFinal()Marks this object as final, and disallows any further changes to this. If this is called thenasUnmodifiable()
will return this object.- Returns:
- this.
-
copy
LimitedFixedItemInv copy()Creates a copy of thisLimitedFixedItemInv
(with the same backing inventory and the same rules). If this has been marked as final (markFinal()
) then the copy will be marked as final as well.. -
reset
Completely clears all rules currently imposed.- Returns:
- This.
-
asUnmodifiable
- Returns:
- A new
FixedItemInv
with the current rules of this, but that cannot be modified.
-
getRule
- Returns:
- A rule for the single slot.
-
getSubRule
- Parameters:
from
- The first slot (inclusive)to
- The last slot (exclusive).- Returns:
- A rule that applies to every slot between from and to.
-
getAllRule
- Returns:
- A rule that applies to every slot in this inventory.
-