Package alexiil.mc.lib.attributes.fluid
Interface FluidInsertable
- All Superinterfaces:
- LimitedConsumer<FluidVolume>
- All Known Subinterfaces:
- FluidTransferable,- GroupedFluidInv,- LimitedGroupedFluidInv
- All Known Implementing Classes:
- CombinedFluidInsertable,- CombinedGroupedFluidInv,- DelegatingGroupedFluidInv,- EmptyFluidTransferable,- EmptyGroupedFluidInv,- FilteredFluidInsertable,- FilteredFluidTransferable,- GroupedFluidInvFixedWrapper,- ItemBasedSingleFluidInv,- JumboFixedFluidInv,- RejectingFluidInsertable,- SimpleFixedFluidInv,- SimpleFixedFluidInvInsertable,- SimpleLimitedGroupedFluidInv,- SingleFluidTank
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines an object that can have fluids inserted into it.
- 
Method SummaryModifier and TypeMethodDescriptionattemptInsertion(FluidVolume fluid, Simulation simulation)Inserts the given stack into this insertable, and returns the excess.default FluidInsertablefiltered(FluidFilter filter)default FluidFilterReturns anFluidFilterto determine ifattemptInsertion(FluidVolume, Simulation)could ever accept a fluid.default FluidAmountdefault FluidInsertabledefault FluidVolumeinsert(FluidVolume fluid)Inserts the given stack into this insertable, and returns the excess.default booleanoffer(FluidVolume object)Deprecated.default booleanoffer(FluidVolume fluid, Simulation simulation)Deprecated.This is an override forLimitedConsumer, for the full javadoc you probably want to callattemptInsertion(FluidVolume, Simulation)directly.default booleanwouldAccept(FluidVolume object)Deprecated.This is an override forLimitedConsumer, for the full javadoc you probably want to callattemptInsertion(FluidVolume, Simulation.SIMULATE) directly.
- 
Method Details- 
attemptInsertionInserts the given stack into this insertable, and returns the excess.- Parameters:
- fluid- The incoming fluid. Must not be modified by this call.
- simulation- If- Simulation.SIMULATEthen this shouldn't modify anything.
- Returns:
- the excess FluidVolumethat wasn't accepted. This will be independent of this insertable, however it might be the given object instead of a completely new object.
 
- 
offerDeprecated.This is an override forLimitedConsumer, for the full javadoc you probably want to callattemptInsertion(FluidVolume, Simulation)directly.- Specified by:
- offerin interface- LimitedConsumer<FluidVolume>
- Parameters:
- fluid- The object to offer. This interface makes no guarantees about whether this object will be defensively copied or not - so callers should assume that any objects passed to this may be modified in any way. Likewise, this has no requirements for what callers may do with the object after it has been passed in.
- simulation- If- Simulation.ACTIONthen this will modify state (if accepted).
- Returns:
- True if the object would have been accepted.
 
- 
offerDeprecated.This is an override forLimitedConsumer, for the full javadoc you probably want to callinsert(FluidVolume)directly.- Specified by:
- offerin interface- LimitedConsumer<FluidVolume>
- Parameters:
- object- The object to offer. This interface makes no guarantees about whether this object will be defensively copied or not - so callers should assume that any objects passed to this may be modified in any way. Likewise, this has no requirements for what callers may do with the object after it has been passed in
- Returns:
- True if the offer was accepted, or false if nothing happened.
 
- 
wouldAcceptDeprecated.This is an override forLimitedConsumer, for the full javadoc you probably want to callattemptInsertion(FluidVolume, Simulation.SIMULATE) directly.- Specified by:
- wouldAcceptin interface- LimitedConsumer<FluidVolume>
- Parameters:
- object- The object to test for. This interface makes no guarantees about whether this object will be defensively copied or not - so callers should assume that any objects passed to this may be modified in any way. Likewise, this has no requirements for what callers may do with the object after it has been passed in
- Returns:
- True if the offer was accepted, or false if nothing happened.
 
- 
insertInserts the given stack into this insertable, and returns the excess.This is equivalent to calling attemptInsertion(FluidVolume, Simulation)with aSimulationparameter ofACTION.- Parameters:
- fluid- The incoming fluid. Must not be modified by this call.
- Returns:
- the excess FluidVolumethat wasn't accepted. This will be independent of this insertable, however it might be the given stack instead of a completely new object.
 
- 
getMinimumAcceptedAmount- Returns:
- The minimum amount of fluid that attemptInsertion(FluidVolume, Simulation)will actually accept. Note that this only provides a guarantee thatfluid volumeswith anamountless than this will never be accepted.A null return value indicates that there is no minimum value. 
 
- 
getInsertionFilterReturns anFluidFilterto determine ifattemptInsertion(FluidVolume, Simulation)could ever accept a fluid. The default implementation is to returnConstantFluidFilter.ANYTHING, and so it is recommended that custom insertables override this to return a more accurate filter.- Returns:
- A filter to determine if the given fluid could ever be inserted.
 
- 
filtered- Returns:
- A new FluidInsertablethat has an additional filter applied to the fluid inserted into it.
 
- 
getPureInsertable- Returns:
- An object that only implements FluidInsertable, and does not expose any of the other modification methods that sibling or subclasses offer (likeFluidExtractableorGroupedFluidInv.
 
 
- 
LimitedConsumer, for the full javadoc you probably want to callinsert(FluidVolume)directly.