Example usage for net.minecraftforge.fluids.capability.templates FluidHandlerItemStack getFluid

List of usage examples for net.minecraftforge.fluids.capability.templates FluidHandlerItemStack getFluid

Introduction

In this page you can find the example usage for net.minecraftforge.fluids.capability.templates FluidHandlerItemStack getFluid.

Prototype

@Nonnull
    public FluidStack getFluid() 

Source Link

Usage

From source file:com.buuz135.industrial.item.MeatFeederItem.java

License:Open Source License

public int getFilledAmount(ItemStack stack) {
    FluidHandlerItemStack handlerItemStack = (FluidHandlerItemStack) stack
            .getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.DOWN);
    return (handlerItemStack.getFluid() == null ? 0 : handlerItemStack.getFluid().amount);
}