Java Code Examples for net.minecraftforge.fluids.FluidStack#EMPTY

The following examples show how to use net.minecraftforge.fluids.FluidStack#EMPTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TileEnderTank.java    From EnderStorage with MIT License 5 votes vote down vote up
@Override
public int comparatorInput() {
    IFluidTank tank = getStorage();
    FluidStack fluid = tank.getFluid();
    if (fluid == null) {
        fluid = FluidStack.EMPTY;
    }
    return fluid.getAmount() * 14 / tank.getCapacity() + (fluid.getAmount() > 0 ? 1 : 0);
}
 
Example 2
Source File: MCDataInput.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Reads a {@link FluidStack} from the stream.
 *
 * @return The {@link FluidStack}.
 */
default FluidStack readFluidStack() {
    if (!readBoolean()) {
        return FluidStack.EMPTY;
    } else {
        Fluid fluid = readRegistryIdUnsafe(ForgeRegistries.FLUIDS);
        int amount = readVarInt();
        CompoundNBT tag = readCompoundNBT();
        if (fluid == Fluids.EMPTY) {
            return FluidStack.EMPTY;
        }
        return new FluidStack(fluid, amount, tag);
    }
}
 
Example 3
Source File: TankSynchroniser.java    From EnderStorage with MIT License 4 votes vote down vote up
public FluidStack getLiquid(Frequency freq) {
    String key = freq.toString();
    a_visible.add(freq);
    PlayerItemTankState state = tankStates.get(key);
    return state == null ? FluidStack.EMPTY : state.c_liquid;
}
 
Example 4
Source File: TankSynchroniser.java    From EnderStorage with MIT License 4 votes vote down vote up
public static FluidStack getClientLiquid(Frequency freq) {
    if (clientState != null) {
        return clientState.getLiquid(freq);
    }
    return FluidStack.EMPTY;
}