Class SimpleLimitedFixedFluidInv
java.lang.Object
alexiil.mc.lib.attributes.fluid.impl.DelegatingFixedFluidInv
alexiil.mc.lib.attributes.fluid.impl.SimpleLimitedFixedFluidInv
- All Implemented Interfaces:
- Convertible,- FixedFluidInv,- FixedFluidInvView,- LimitedFixedFluidInv
public class SimpleLimitedFixedFluidInv
extends DelegatingFixedFluidInv
implements LimitedFixedFluidInv
- 
Nested Class SummaryNested classes/interfaces inherited from interface alexiil.mc.lib.attributes.fluid.LimitedFixedFluidInvLimitedFixedFluidInv.FluidTankLimitRule
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected FluidFilter[]protected FluidAmount[]Array of maximum amounts that can be inserted up to.protected FluidAmount[]Array of minimum amounts that can be extracted down to.Fields inherited from class alexiil.mc.lib.attributes.fluid.impl.DelegatingFixedFluidInvdelegate
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcopy()Creates a copy of thisLimitedFixedItemInv(with the same backing inventory and the same rules).getFilterForTank(int tank)ExposesFixedFluidInvView.isFluidValidForTank(int, FluidKey)as a (potentially) readable filter.getMaxAmount_F(int tank)getRule(int tank)getSubRule(int from, int to)booleanisFluidValidForTank(int tank, FluidKey fluid)Checks to see if the given fluid would be valid for this tank, ignoring current contents.Marks this object as final, and disallows any further changes to this.booleansetInvFluid(int tank, FluidVolume to, Simulation simulation)Sets the fluid in the given tank to the given fluid.Methods inherited from class alexiil.mc.lib.attributes.fluid.impl.DelegatingFixedFluidInvaddListener, getInvFluid, getMaxAmount, getTankCountMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface alexiil.mc.lib.attributes.fluid.FixedFluidInvcreateLimitedFixedInv, extractFluid, forceSetInvFluid, getExtractable, getInsertable, getMappedInv, getSubInv, getTank, getTransferable, insertFluid, modifyTank, tankIterableMethods inherited from interface alexiil.mc.lib.attributes.fluid.FixedFluidInvViewaddListener, convertTo, fluidIterable, getFixedView, getInvFluid, getMaxAmount, getTankCount, offerSelfAsAttributeMethods inherited from interface alexiil.mc.lib.attributes.fluid.LimitedFixedFluidInvasUnmodifiable, getAllRule, reset
- 
Field Details- 
insertionFilters
- 
maxInsertionAmountsArray of maximum amounts that can be inserted up to. Null entries are (confusingly) equal to "MAX_VALUE", and not zero.
- 
minimumAmountsArray of minimum amounts that can be extracted down to. Null entries are equal to zero.
 
- 
- 
Constructor Details- 
SimpleLimitedFixedFluidInv
 
- 
- 
Method Details- 
markFinalDescription copied from interface:LimitedFixedFluidInvMarks this object as final, and disallows any further changes to this. If this is called thenLimitedFixedFluidInv.asUnmodifiable()will return this object.- Specified by:
- markFinalin interface- LimitedFixedFluidInv
- Returns:
- this.
 
- 
assertMutableprotected void assertMutable()
- 
copyDescription copied from interface:LimitedFixedFluidInvCreates a copy of thisLimitedFixedItemInv(with the same backing inventory and the same rules).- Specified by:
- copyin interface- LimitedFixedFluidInv
 
- 
getGroupedInv- Specified by:
- getGroupedInvin interface- FixedFluidInv
- Specified by:
- getGroupedInvin interface- FixedFluidInvView
- Returns:
- A statistical view of this inventory.
 
- 
isFluidValidForTankDescription copied from interface:FixedFluidInvChecks to see if the given fluid would be valid for this tank, ignoring current contents. Note that this method should adhere to the requirements ofFluidFilter.matches(FluidKey), so passingemptyfluids will generally not return useful results.Note that just because an FluidKeypasses this validity test, and is mergable with the current fluid, does not mean that you can insert the fluid into this inventory.- Specified by:
- isFluidValidForTankin interface- FixedFluidInv
- Specified by:
- isFluidValidForTankin interface- FixedFluidInvView
- Overrides:
- isFluidValidForTankin class- DelegatingFixedFluidInv
- Parameters:
- tank- The tank index. Must be a value between 0 (inclusive) and- FixedFluidInvView.getTankCount()(exclusive) to be valid. (Like in arrays, lists, etc).
 
- 
getFilterForTankDescription copied from interface:FixedFluidInvViewExposesFixedFluidInvView.isFluidValidForTank(int, FluidKey)as a (potentially) readable filter.- Specified by:
- getFilterForTankin interface- FixedFluidInvView
- Overrides:
- getFilterForTankin class- DelegatingFixedFluidInv
- Parameters:
- tank- The tank index. Must be a value between 0 (inclusive) and- FixedFluidInvView.getTankCount()(exclusive) to be valid. (Like in arrays, lists, etc).
- Returns:
- An FluidFilterfor this tank. If this tank is filtered by anFluidFilterinternally then it is highly recommended that this be overridden to return that filter rather than the default opaque wrapper aroundFixedFluidInvView.isFluidValidForTank(int, FluidKey).
 
- 
setInvFluidDescription copied from interface:FixedFluidInvSets the fluid in the given tank to the given fluid.- Specified by:
- setInvFluidin interface- FixedFluidInv
- Overrides:
- setInvFluidin class- DelegatingFixedFluidInv
- Returns:
- True if the modification was allowed, false otherwise. (For example if the given stack doesn't pass the
         FixedFluidInvView.isFluidValidForTank(int, FluidKey)test).
 
- 
getMaxAmount_F- Specified by:
- getMaxAmount_Fin interface- FixedFluidInvView
- Overrides:
- getMaxAmount_Fin class- DelegatingFixedFluidInv
- Parameters:
- tank- The tank index. Must be a value between 0 (inclusive) and- FixedFluidInvView.getTankCount()(exclusive) to be valid. (Like in arrays, lists, etc).
- Returns:
- The maximum amount that the given tank can hold of the given fluid. This method will ignore the current
         stack in FixedFluidInvView.getInvFluid(int). Note that any setters that this object implements (likeFixedFluidInv.setInvFluid(int, FluidVolume, Simulation)should reject stacks that are greater than this value. (and callers should only call this if they need to check the amounts separately. Note that it is meaningless to return values greater than the maximum amount an fluid can be stacked to here, and callers are free to throw an exception if this is violated. (Basically huge single-tank inventories shouldn't implement this interface).
 
- 
getRule- Specified by:
- getRulein interface- LimitedFixedFluidInv
- Returns:
- A rule for the single tank.
 
- 
getSubRule- Specified by:
- getSubRulein interface- LimitedFixedFluidInv
- Parameters:
- from- The first tank (inclusive)
- to- The last tank (exclusive).
- Returns:
- A rule that applies to every tank between from and to.
 
 
-