/* * Copyright (c) 2016, 2017, 2018, 2019 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.fabricmc.fabric.api.fluid.v1.fluid; import net.minecraft.fluid.Fluid; public interface ImmutableFluidVolume { // Common unit denominators int BUCKET = 1; int KILOLITER = 1; int LITER = 1000; int BLOCK = 1; int SLAB = 2; int BOTTLE = 3; int QUARTER = 4; int INGOT = 9; int NUGGET = 81; Fluid fluid(); /** * Returns current amount in stack scaled so that that 1.0 = one of the given units. * May be approximate due to floating point error. Intended primarily for user display. */ double volumeForDisplay(long units); /** * Returns the number of units that is less than or equal to contents. * Make contain more than this if contents are not evenly divisible . */ long getVolume(long units); /** * True if tank is absolutely empty. */ boolean isEmpty(); /** * True if filled volume is less than the given unit. */ boolean isEmpty(long units); /** * Max fill volume measured in BUCKETS. * (Max can't be a fractional unit. That way lies madness.) */ long getMaxBuckets(); /** * Returns self if already immutable. */ ImmutableFluidVolume toImmutable(); }