Class ExtractOnlyFluidContainer
java.lang.Object
earth.terrarium.botarium.common.fluid.impl.SimpleFluidContainer
earth.terrarium.botarium.common.fluid.impl.ExtractOnlyFluidContainer
- All Implemented Interfaces:
FluidContainer,Serializable,net.minecraft.world.Clearable
-
Field Summary
Fields inherited from class earth.terrarium.botarium.common.fluid.impl.SimpleFluidContainer
FLUID_KEY, fluidFilter, maxAmount, storedFluid -
Constructor Summary
ConstructorsConstructorDescriptionExtractOnlyFluidContainer(IntToLongFunction maxAmount, int tanks, BiPredicate<Integer, FluidHolder> fluidFilter) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonginsertFluid(FluidHolder fluid, boolean simulate) Inserts aFluidHolderinto the container.longinternalInsert(FluidHolder fluid, boolean simulate) An internal version ofFluidContainer.insertFluid(FluidHolder, boolean)that is used by mod authors looking to directly interact with their own containers.Methods inherited from class earth.terrarium.botarium.common.fluid.impl.SimpleFluidContainer
allowsExtraction, clearContent, copy, createSnapshot, deserialize, extractFluid, extractFromSlot, fromContainer, getFluids, getSize, getTankCapacity, internalExtract, isEmpty, isFluidValid, serialize, setFluidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface earth.terrarium.botarium.common.fluid.base.FluidContainer
readSnapshot
-
Constructor Details
-
ExtractOnlyFluidContainer
public ExtractOnlyFluidContainer(IntToLongFunction maxAmount, int tanks, BiPredicate<Integer, FluidHolder> fluidFilter)
-
-
Method Details
-
insertFluid
Description copied from interface:FluidContainerInserts aFluidHolderinto the container.- Specified by:
insertFluidin interfaceFluidContainer- Overrides:
insertFluidin classSimpleFluidContainer- Parameters:
fluid- TheFluidHolderto be inserted into the container.simulate- If true, the container will not be modified.- Returns:
- The amount of fluid that was added to the container.
-
internalInsert
Description copied from interface:FluidContainerAn internal version ofFluidContainer.insertFluid(FluidHolder, boolean)that is used by mod authors looking to directly interact with their own containers.You should not call this method for other mod's containers, instead use
FluidContainer.insertFluid(FluidHolder, boolean).- Specified by:
internalInsertin interfaceFluidContainer- Overrides:
internalInsertin classSimpleFluidContainer
-
allowsInsertion
public boolean allowsInsertion()- Specified by:
allowsInsertionin interfaceFluidContainer- Overrides:
allowsInsertionin classSimpleFluidContainer- Returns:
- Weather can be inserted into.
-