Class FluidHandlerItemStack.SwapEmpty
java.lang.Object
net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack
net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack.SwapEmpty
- All Implemented Interfaces:
IFluidHandler
,IFluidHandlerItem
- Enclosing class:
FluidHandlerItemStack
Swaps the container item for a different one when it's emptied.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack
FluidHandlerItemStack.Consumable, FluidHandlerItemStack.SwapEmpty
Nested classes/interfaces inherited from interface net.neoforged.neoforge.fluids.capability.IFluidHandler
IFluidHandler.FluidAction
-
Field Summary
Fields inherited from class net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack
capacity, componentType, container
-
Constructor Summary
ConstructorDescriptionSwapEmpty
(Supplier<DataComponentType<SimpleFluidContent>> componentType, ItemStack container, ItemStack emptyContainer, int capacity) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Override this method for special handling.Methods inherited from class net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack
canDrainFluidType, canFillFluidType, drain, drain, fill, getContainer, getFluid, getFluidInTank, getTankCapacity, getTanks, isFluidValid, setFluid
-
Field Details
-
emptyContainer
-
-
Constructor Details
-
SwapEmpty
public SwapEmpty(Supplier<DataComponentType<SimpleFluidContent>> componentType, ItemStack container, ItemStack emptyContainer, int capacity)
-
-
Method Details
-
setContainerToEmpty
protected void setContainerToEmpty()Description copied from class:FluidHandlerItemStack
Override this method for special handling. Can be used to swap out or destroy the container.- Overrides:
setContainerToEmpty
in classFluidHandlerItemStack
-