private static boolean canFill(IFluidHandler fluidHandler) { for (IFluidTankProperties properties : fluidHandler.getTankProperties()) { if (properties.canFill()) { return true; } } return false; } }
public static boolean isFillableContainer(ItemStack container) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (properties.canFill()) { return true; } } return false; }
public static boolean isFillableEmptyContainer(ItemStack empty) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(empty); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (!properties.canFill()) { return false; } FluidStack contents = properties.getContents(); if (contents != null && contents.amount > 0) { return false; } } return true; }
public static boolean isFillableEmptyContainer(ItemStack empty) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(empty); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (!properties.canFill()) { return false; } FluidStack contents = properties.getContents(); if (contents != null && contents.amount > 0) { return false; } } return true; }
public static boolean isFillableContainerAndEmpty(ItemStack container) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (contents == null) { return true; } else if (contents.amount > 0) { return false; } } } return false; }
public static boolean isFillableContainerAndEmpty(ItemStack container) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (contents == null) { continue; } else if (contents.amount > 0) { return false; } } } return tankProperties.length > 0; }
public static boolean isFillableContainerWithRoom(ItemStack container) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (contents == null) { return true; } else if (contents.amount < properties.getCapacity()) { return true; } } } return false; }
public static boolean isFillableContainerWithRoom(ItemStack container) { IFluidHandler fluidHandler = FluidUtil.getFluidHandler(container); if (fluidHandler == null) { return false; } IFluidTankProperties[] tankProperties = fluidHandler.getTankProperties(); for (IFluidTankProperties properties : tankProperties) { if (properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (contents == null) { return true; } else if (contents.amount < properties.getCapacity()) { return true; } } } return false; }
contents == null ? 0 : contents.amount, properties.getCapacity(), Boolean.toString(properties.canFill()), Boolean.toString(properties.canDrain())));
if (tankProperties != null) { for (IFluidTankProperties properties : tankProperties) { if (properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (tank.getFluid() != null) {
if (tankProperties != null) { for (IFluidTankProperties properties : tankProperties) { if (properties != null && properties.canFill() && properties.getCapacity() > 0) { FluidStack contents = properties.getContents(); if (tank.getFluid() != null) {