Merge pull request #1109 from Open-Code-Developers/finite-patch
Make finite fluid blocks drainable
This commit is contained in:
commit
4a6a49e073
1 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -310,12 +311,18 @@ public class BlockFluidFinite extends BlockFluidBase
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
||||||
{
|
{
|
||||||
return null;
|
if (doDrain)
|
||||||
|
{
|
||||||
|
world.setBlock(x, y, z, Blocks.air);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new FluidStack(getFluid(),
|
||||||
|
MathHelper.floor_float(getQuantaPercentage(world, x, y, z) * FluidContainerRegistry.BUCKET_VOLUME));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(World world, int x, int y, int z)
|
public boolean canDrain(World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue