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:
parent
a42369e081
commit
077e05e0ed
2 changed files with 27 additions and 3 deletions
|
@ -121,8 +121,16 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.density > getDensity(world, x, y, z))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to displace the block at (x, y, z), return true if it was displaced.
|
* 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;
|
return false;
|
||||||
}
|
}
|
||||||
Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
Block.blocksList[bId].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||||
|
|
||||||
|
if (this.density > getDensity(world, x, y, z))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z);
|
public abstract int getQuantaValue(IBlockAccess world, int x, int y, int z);
|
||||||
|
|
||||||
|
|
|
@ -302,8 +302,16 @@ public class BlockFluidClassic extends BlockFluidBase
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.density > getDensity(world, x, y, z))
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected int getLargerQuanta(IBlockAccess world, int x, int y, int z, int compare)
|
protected int getLargerQuanta(IBlockAccess world, int x, int y, int z, int compare)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue