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
@Deprecated(since="1.21.9",
forRemoval=true)
public static class FluidHandlerItemStackSimple.SwapEmpty
extends FluidHandlerItemStackSimple
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.FluidHandlerItemStackSimple
FluidHandlerItemStackSimple.Consumable, FluidHandlerItemStackSimple.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.FluidHandlerItemStackSimple
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.FluidHandlerItemStackSimple
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:FluidHandlerItemStackSimpleOverride 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:
setContainerToEmptyin classFluidHandlerItemStackSimple
-
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.