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,7 +121,15 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
{
return false;
}
return true;
if (this.density > getDensity(world, x, y, z))
{
return true;
}
else
{
return false;
}
}
/**
@ -156,7 +164,15 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
return false;
}
Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
return true;
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,7 +302,15 @@ public class BlockFluidClassic extends BlockFluidBase
{
return false;
}
return true;
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)