Package alexiil.mc.lib.attributes.fluid
Interface LimitedFixedFluidInv
- All Superinterfaces:
Convertible
,FixedFluidInv
,FixedFluidInvView
- All Known Implementing Classes:
SimpleLimitedFixedFluidInv
public interface LimitedFixedFluidInv extends FixedFluidInv
A type of
FixedFluidInv
that wraps an existing FixedFluidInv
and provides custom control over the
actual modification of the wrapped FixedFluidInv
.
Note that it is never possible to get the wrapped FixedFluidInv
from this class.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LimitedFixedFluidInv.FluidTankLimitRule
A rule for a set of tanks. -
Method Summary
Modifier and Type Method Description default FixedFluidInv
asUnmodifiable()
LimitedFixedFluidInv
copy()
Creates a copy of thisLimitedFixedItemInv
(with the same backing inventory and the same rules).default LimitedFixedFluidInv.FluidTankLimitRule
getAllRule()
LimitedFixedFluidInv.FluidTankLimitRule
getRule(int tank)
LimitedFixedFluidInv.FluidTankLimitRule
getSubRule(int from, int to)
LimitedFixedFluidInv
markFinal()
Marks this object as final, and disallows any further changes to this.default LimitedFixedFluidInv
reset()
Completely clears all rules currently imposed.Methods inherited from interface alexiil.mc.lib.attributes.fluid.FixedFluidInv
createLimitedFixedInv, extractFluid, forceSetInvFluid, getExtractable, getGroupedInv, getInsertable, getMappedInv, getSubInv, getTank, getTransferable, insertFluid, isFluidValidForTank, modifyTank, setInvFluid, tankIterable
Methods inherited from interface alexiil.mc.lib.attributes.fluid.FixedFluidInvView
addListener, convertTo, fluidIterable, getFilterForTank, getFixedView, getInvFluid, getMaxAmount, getMaxAmount_F, getTankCount, offerSelfAsAttribute
-
Method Details
-
markFinal
LimitedFixedFluidInv 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
LimitedFixedFluidInv copy()Creates a copy of thisLimitedFixedItemInv
(with the same backing inventory and the same rules). -
reset
Completely clears all rules currently imposed.- Returns:
- This.
-
asUnmodifiable
- Returns:
- A new
FixedFluidInv
with the current rules of this, but that cannot be modified.
-
getRule
- Returns:
- A rule for the single tank.
-
getSubRule
- Parameters:
from
- The first tank (inclusive)to
- The last tank (exclusive).- Returns:
- A rule that applies to every tank between from and to.
-
getAllRule
- Returns:
- A rule that applies to every tank in this inventory.
-