public static ItemStack setLiquid(ItemStack bucket, FluidStack liquid) { if (LiquidRegistry.getName(liquid) != null) { bucket.stackSize = 1; bucket.setItemDamage(LiquidRegistry.getID(liquid)); } return bucket; }
public static void registerAsContainer(Fluid fluid) { FluidStack stack = FluidRegistry.getFluidStack(fluid.getName(), FluidContainerRegistry.BUCKET_VOLUME); stack = stack.copy(); stack.amount = cell.volume; FluidContainerRegistry.registerFluidContainer( new FluidContainerData( stack, new ItemStack(cell, 1, LiquidRegistry.getID(stack)), new ItemStack(cell, 1, 0))); }
public ItemStack setLiquid(ItemStack bucket, FluidStack liquid, EntityPlayer par3EntityPlayer) { CarbonContainer item = (CarbonContainer) bucket.getItem(); if (liquid == null || liquid.amount < item.volume) return bucket; int id = LiquidRegistry.getID(liquid); if (--bucket.stackSize <= 0) { bucket = new ItemStack(item.filledItem, 1, id); } else { ItemStack bucket2 = new ItemStack(item.filledItem, 1, id); if (!par3EntityPlayer.inventory.addItemStackToInventory(bucket2)) par3EntityPlayer.func_146097_a(bucket2, false, true); } liquid.amount -= item.volume; return bucket; }