Class FluidHandlerItemStackSimple.SwapEmpty
java.lang.Object
net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStackSimple
net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStackSimple.SwapEmpty
- All Implemented Interfaces:
IFluidHandler
,IFluidHandlerItem
- Enclosing class:
FluidHandlerItemStackSimple
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.FluidHandlerItemStackSimple
FluidHandlerItemStackSimple.Consumable, FluidHandlerItemStackSimple.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.FluidHandlerItemStackSimple
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.FluidHandlerItemStackSimple
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:FluidHandlerItemStackSimple
Override this method for special handling. Can be used to swap out the container's item for a different one with "container.setItem". Can be used to destroy the container with "container.stackSize--"- Overrides:
setContainerToEmpty
in classFluidHandlerItemStackSimple
-