if(item == null) {
return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9);
}
//check for filled fluid containers and see if we can empty them into our input tank
FluidStack fluid = FluidUtil.getFluidFromItem(item);
if(fluid != null) {
int filled = vat.fill(ForgeDirection.UP, fluid, false);
if(filled >= fluid.amount) {
vat.fill(ForgeDirection.UP, fluid, true);
if(!entityPlayer.capabilities.isCreativeMode) {
entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, Util.consumeItem(item));
}
return true;
}
}
//now check for empty fluid containers to fill
FluidStack available = vat.outputTank.getFluid();
if(available != null) {
ItemStack res = FluidContainerRegistry.fillFluidContainer(available.copy(), item);
FluidStack filled = FluidContainerRegistry.getFluidForFilledItem(res);
if(filled == null) { //this shouldn't be necessary but it appears to be a bug as the above method doesnt work
FluidContainerData[] datas = FluidContainerRegistry.getRegisteredFluidContainerData();
for (FluidContainerData data : datas) {
if(data != null && data.fluid.getFluid().getName().equals(available.getFluid().getName()) && data.emptyContainer.isItemEqual(item)) {