Package alexiil.mc.lib.attributes.fluid
Class FluidContainerRegistry.FluidFillHandler
java.lang.Object
alexiil.mc.lib.attributes.fluid.FluidContainerRegistry.FluidFillHandler
- Enclosing class:
- FluidContainerRegistry
public abstract static class FluidContainerRegistry.FluidFillHandler
extends java.lang.Object
Fill handler for an empty
ItemStack
. This is registered with. Alternatively you can implement the
functional interface variant FluidContainerRegistry.FluidFillFunction
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FluidContainerRegistry.FluidFillHandler.StackReturnFunc
Stack return function forinsert(ItemStack, FluidVolume, Simulation, StackReturnFunc)
-
Field Summary
Fields Modifier and Type Field Description FluidAmount
minimum
-
Constructor Summary
Constructors Constructor Description FluidFillHandler(FluidAmount minimum)
-
Method Summary
Modifier and Type Method Description protected abstract FluidAmount
getCapacity(FluidFilter filter)
protected abstract FluidVolume
insert(net.minecraft.item.ItemStack stack, FluidVolume fluid, Simulation simulation, FluidContainerRegistry.FluidFillHandler.StackReturnFunc stackReturn)
-
Field Details
-
Constructor Details
-
Method Details
-
insert
protected abstract FluidVolume insert(net.minecraft.item.ItemStack stack, FluidVolume fluid, Simulation simulation, FluidContainerRegistry.FluidFillHandler.StackReturnFunc stackReturn)- Parameters:
stack
- A copy of theItemStack
that was stored in theStackReference
.fluid
- The fluid to insert. (So you should always copy this rather than modify it). Note that this will never be empty, or have an amount less thanminimum
.simulation
-stackReturn
- A function to set the new stacks to.- Returns:
- The excess
FluidVolume
that couldn't be inserted.
-
getCapacity
- Parameters:
filter
- the fluids to test.- Returns:
-