Package alexiil.mc.lib.attributes.item
Interface LimitedFixedItemInv.ItemSlotLimitRule
- Enclosing interface:
- LimitedFixedItemInv
public static interface LimitedFixedItemInv.ItemSlotLimitRule
A rule for a set of slots.
-
Method Summary
Modifier and TypeMethodDescriptionStops disallowing extraction of items.Stops disallowing insertion of items by setting thelimitInsertionCount(int)
to 64.Completely disallows extraction of items.Completely disallows inserting items by setting thelimitInsertionCount(int)
to 0.filterExtracts
(ItemFilter filter) Filters all extractions with the given filter in addition to whatever filters are already present.filterInserts
(ItemFilter filter) Filters all insertions with the given filter in addition to whatever filters are already present.limitInsertionCount
(int max) Limits the number of items that can be inserted (in total) to the given count.Removes the currentextraction filter
.Removes the currentinsertion filter
.Deprecated, for removal: This API element is subject to removal in a future version.reset()
Clears all limitations for this current rule.setMinimum
(int min) Limits the number of items that can be extracted to ensure that this slot cannot have an amount that goes below the given value.
-
Method Details
-
reset
Clears all limitations for this current rule. -
disallowExtraction
Completely disallows extraction of items.- Returns:
- this.
-
allowExtraction
Stops disallowing extraction of items.- Returns:
- this.
-
filterInserts
Filters all insertions with the given filter in addition to whatever filters are already present.- Parameters:
filter
- Null orConstantItemFilter.ANYTHING
to clear the current filter.
-
filterExtracts
Filters all extractions with the given filter in addition to whatever filters are already present.- Parameters:
filter
- Null orConstantItemFilter.ANYTHING
to clear the current filter.
-
noInsertionLimits
@Deprecated(since="0.5.1", forRemoval=true) default LimitedFixedItemInv.ItemSlotLimitRule noInsertionLimits()Deprecated, for removal: This API element is subject to removal in a future version.Because this is ambiguous as the name could refer to the count, or the filter, so instead you should usenoInsertionFilter()
.Removes the currentfilterInserts(ItemFilter)
. -
noInsertionFilter
Removes the currentinsertion filter
. -
noExtractionFilter
Removes the currentextraction filter
. -
disallowInsertion
Completely disallows inserting items by setting thelimitInsertionCount(int)
to 0. (This leaves thefilterInserts(ItemFilter)
alone, however setting it toConstantItemFilter.NOTHING
would have the same effect).- Returns:
- this.
-
allowInsertion
Stops disallowing insertion of items by setting thelimitInsertionCount(int)
to 64.- Returns:
- this.
-
limitInsertionCount
Limits the number of items that can be inserted (in total) to the given count.- Parameters:
max
- The maximum, clamped between 0 and 64. (A value of 0 disallows insertion, and a value of 64 removes the limit).- Returns:
- this.
-
setMinimum
Limits the number of items that can be extracted to ensure that this slot cannot have an amount that goes below the given value. (This of course has no effect on the underlying inventory, so it is always possible for the underlying inventory to be modified to contain less than the given amount).- Parameters:
min
- The minimum, clamped between 0 and 64. (A value of 0 removes this limit, and a value of 64 disallows extraction).- Returns:
- this.
-
noInsertionFilter()
.