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
@Deprecated(since="1.21.9",
forRemoval=true)
public static class FluidHandlerItemStack.SwapEmpty
extends FluidHandlerItemStack
Deprecated, for removal: This API element is subject to removal in a future version.
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.SwapEmptyNested classes/interfaces inherited from interface net.neoforged.neoforge.fluids.capability.IFluidHandler
IFluidHandler.FluidAction -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ItemStackDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class net.neoforged.neoforge.fluids.capability.templates.FluidHandlerItemStack
capacity, componentType, container -
Constructor Summary
ConstructorsConstructorDescriptionSwapEmpty(Supplier<DataComponentType<SimpleFluidContent>> componentType, ItemStack container, ItemStack emptyContainer, int capacity) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
SwapEmpty
public SwapEmpty(Supplier<DataComponentType<SimpleFluidContent>> componentType, ItemStack container, ItemStack emptyContainer, int capacity) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setContainerToEmpty
protected void setContainerToEmpty()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:FluidHandlerItemStackOverride this method for special handling. Can be used to swap out or destroy the container.- Overrides:
setContainerToEmptyin classFluidHandlerItemStack
-
ItemAccessFluidHandlerinstead, with an override ofItemAccessFluidHandler.update(net.neoforged.neoforge.transfer.item.ItemResource, int, net.neoforged.neoforge.transfer.fluid.FluidResource, int)to return a different item resource if the fluid amount is 0.