From 077e05e0ed358de6f9f6b3520714a10fc593a875 Mon Sep 17 00:00:00 2001 From: tommy1019 Date: Fri, 26 Jul 2013 16:25:40 -0500 Subject: [PATCH] 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. --- .../minecraftforge/fluids/BlockFluidBase.java | 20 +++++++++++++++++-- .../fluids/BlockFluidClassic.java | 10 +++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/common/net/minecraftforge/fluids/BlockFluidBase.java b/common/net/minecraftforge/fluids/BlockFluidBase.java index 5aea68e428..a3bc54f76d 100644 --- a/common/net/minecraftforge/fluids/BlockFluidBase.java +++ b/common/net/minecraftforge/fluids/BlockFluidBase.java @@ -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); diff --git a/common/net/minecraftforge/fluids/BlockFluidClassic.java b/common/net/minecraftforge/fluids/BlockFluidClassic.java index ae63e2cebc..4defe7f6e9 100644 --- a/common/net/minecraftforge/fluids/BlockFluidClassic.java +++ b/common/net/minecraftforge/fluids/BlockFluidClassic.java @@ -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)