use of net.minecraftforge.fluids.capability.FluidTankProperties in project MinecraftForge by MinecraftForge.
the class BlockLiquidWrapper method getTankProperties.
@Override
public IFluidTankProperties[] getTankProperties() {
FluidStack containedStack = null;
IBlockState blockState = world.getBlockState(blockPos);
if (blockState.getBlock() == blockLiquid) {
containedStack = getStack(blockState);
}
return new FluidTankProperties[] { new FluidTankProperties(containedStack, Fluid.BUCKET_VOLUME, false, true) };
}
use of net.minecraftforge.fluids.capability.FluidTankProperties in project MinecraftForge by MinecraftForge.
the class FluidBlockWrapper method getTankProperties.
@Override
public IFluidTankProperties[] getTankProperties() {
float percentFilled = fluidBlock.getFilledPercentage(world, blockPos);
if (percentFilled < 0) {
percentFilled *= -1;
}
int amountFilled = Math.round(Fluid.BUCKET_VOLUME * percentFilled);
FluidStack fluid = amountFilled > 0 ? new FluidStack(fluidBlock.getFluid(), amountFilled) : null;
return new FluidTankProperties[] { new FluidTankProperties(fluid, Fluid.BUCKET_VOLUME, false, true) };
}
Aggregations