Package alexiil.mc.lib.attributes.item
Interface LimitedFixedItemInv
- All Superinterfaces:
AbstractItemInvView
,Convertible
,FixedItemInv
,FixedItemInvView
- All Known Implementing Classes:
SimpleLimitedFixedItemInv
,SimpleLimitedFixedItemInv.OfCopying
,SimpleLimitedFixedItemInv.OfModifiable
public interface LimitedFixedItemInv extends FixedItemInv
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
Nested Classes Modifier and Type Interface Description static interface
LimitedFixedItemInv.ItemSlotLimitRule
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 Type Method Description default FixedItemInv
asUnmodifiable()
LimitedFixedItemInv
copy()
Creates a copy of thisLimitedFixedItemInv
(with the same backing inventory and the same rules).default LimitedFixedItemInv.ItemSlotLimitRule
getAllRule()
LimitedFixedItemInv.ItemSlotLimitRule
getRule(int slot)
LimitedFixedItemInv.ItemSlotLimitRule
getSubRule(int from, int to)
LimitedFixedItemInv
markFinal()
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.
-