Fixed fluids eating each other

Fluids check for other fluids density before flowing, if their density
is higher they can flow into the other fluid, if not they can't.
This commit is contained in:
tommy1019 2013-07-26 16:25:40 -05:00
parent a42369e081
commit 077e05e0ed
2 changed files with 27 additions and 3 deletions

View file

@ -121,8 +121,16 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
{
return false;
}
if (this.density > getDensity(world, x, y, z))
{
return true;
}
else
{
return false;
}
}
/**
* Attempt to displace the block at (x, y, z), return true if it was displaced.
@ -156,8 +164,16 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
return false;
}
Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
if (this.density > getDensity(world, x, y, z))
{
return true;
}
else
{
return false;
}
}
public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z);

View file

@ -302,8 +302,16 @@ public class BlockFluidClassic extends BlockFluidBase
{
return false;
}
if (this.density > getDensity(world, x, y, z))
{
return true;
}
else
{
return false;
}
}
protected int getLargerQuanta(IBlockAccess world, int x, int y, int z, int compare)
{