Class FluidHandlerItemCapacity
java.lang.Object
net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
org.cyclops.cyclopscore.capability.fluid.FluidHandlerItemCapacity
- All Implemented Interfaces:
net.minecraftforge.common.capabilities.ICapabilityProvider
,net.minecraftforge.common.util.INBTSerializable
,net.minecraftforge.fluids.capability.IFluidHandler
,net.minecraftforge.fluids.capability.IFluidHandlerItem
,IFluidHandlerItemCapacity
,IFluidHandlerMutable
public class FluidHandlerItemCapacity
extends net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
implements IFluidHandlerItemCapacity, IFluidHandlerMutable, net.minecraftforge.common.util.INBTSerializable
An itemfluid handler with a mutable capacity.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack.Consumable, net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack.SwapEmpty
Nested classes/interfaces inherited from interface net.minecraftforge.fluids.capability.IFluidHandler
net.minecraftforge.fluids.capability.IFluidHandler.FluidAction
-
Field Summary
Fields inherited from class net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
capacity, container, FLUID_NBT_KEY
-
Constructor Summary
ConstructorDescriptionFluidHandlerItemCapacity
(net.minecraft.world.item.ItemStack container, int capacity) FluidHandlerItemCapacity
(net.minecraft.world.item.ItemStack container, int capacity, net.minecraft.world.level.material.Fluid fluid) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canFillFluidType
(net.minecraftforge.fluids.FluidStack resource) void
deserializeNBT
(net.minecraft.nbt.Tag nbt) <T> net.minecraftforge.common.util.LazyOptional<T>
getCapability
(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.core.Direction facing) int
net.minecraftforge.fluids.FluidStack
getFluid()
net.minecraft.nbt.Tag
void
setCapacity
(int capacity) void
setFluidInTank
(int tank, net.minecraftforge.fluids.FluidStack fluidStack) Methods inherited from class net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
canDrainFluidType, drain, drain, fill, getContainer, getFluidInTank, getTankCapacity, getTanks, isFluidValid, setContainerToEmpty, setFluid
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.fluids.capability.IFluidHandler
drain, drain, fill, getFluidInTank, getTankCapacity, getTanks, isFluidValid
Methods inherited from interface net.minecraftforge.fluids.capability.IFluidHandlerItem
getContainer
-
Constructor Details
-
FluidHandlerItemCapacity
public FluidHandlerItemCapacity(net.minecraft.world.item.ItemStack container, int capacity) - Parameters:
container
- The container itemStack, data is stored on it directly as NBT.capacity
- The maximum capacity of this fluid tank.
-
FluidHandlerItemCapacity
public FluidHandlerItemCapacity(net.minecraft.world.item.ItemStack container, int capacity, net.minecraft.world.level.material.Fluid fluid) - Parameters:
container
- The container itemStack, data is stored on it directly as NBT.capacity
- The maximum capacity of this fluid tank.fluid
- The accepted fluid.
-
-
Method Details
-
canFillFluidType
public boolean canFillFluidType(net.minecraftforge.fluids.FluidStack resource) - Overrides:
canFillFluidType
in classnet.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
-
setCapacity
public void setCapacity(int capacity) - Specified by:
setCapacity
in interfaceIFluidHandlerItemCapacity
-
getCapacity
public int getCapacity()- Specified by:
getCapacity
in interfaceIFluidHandlerItemCapacity
-
getFluid
@Nullable public net.minecraftforge.fluids.FluidStack getFluid()- Overrides:
getFluid
in classnet.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
-
getCapability
@Nullable public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, net.minecraft.core.Direction facing) - Specified by:
getCapability
in interfacenet.minecraftforge.common.capabilities.ICapabilityProvider
- Overrides:
getCapability
in classnet.minecraftforge.fluids.capability.templates.FluidHandlerItemStack
-
setFluidInTank
public void setFluidInTank(int tank, net.minecraftforge.fluids.FluidStack fluidStack) - Specified by:
setFluidInTank
in interfaceIFluidHandlerMutable
-
serializeNBT
public net.minecraft.nbt.Tag serializeNBT()- Specified by:
serializeNBT
in interfacenet.minecraftforge.common.util.INBTSerializable
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.Tag nbt) - Specified by:
deserializeNBT
in interfacenet.minecraftforge.common.util.INBTSerializable
-