Search in sources :

Example 1 with FluidHandlerItemStack

use of net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack in project MinecraftForge by MinecraftForge.

the class CapabilityFluidHandler method register.

public static void register() {
    CapabilityManager.INSTANCE.register(IFluidHandler.class, new DefaultFluidHandlerStorage<IFluidHandler>(), new Callable<IFluidHandler>() {

        @Override
        public IFluidHandler call() throws Exception {
            return new FluidTank(Fluid.BUCKET_VOLUME);
        }
    });
    CapabilityManager.INSTANCE.register(IFluidHandlerItem.class, new DefaultFluidHandlerStorage<IFluidHandlerItem>(), new Callable<IFluidHandlerItem>() {

        @Override
        public IFluidHandlerItem call() throws Exception {
            return new FluidHandlerItemStack(new ItemStack(Items.BUCKET), Fluid.BUCKET_VOLUME);
        }
    });
}
Also used : FluidTank(net.minecraftforge.fluids.FluidTank) IFluidTank(net.minecraftforge.fluids.IFluidTank) FluidHandlerItemStack(net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack) FluidHandlerItemStack(net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ItemStack (net.minecraft.item.ItemStack)1 FluidTank (net.minecraftforge.fluids.FluidTank)1 IFluidTank (net.minecraftforge.fluids.IFluidTank)1 FluidHandlerItemStack (net.minecraftforge.fluids.capability.templates.FluidHandlerItemStack)1