Browse Source

Rendering Issues should be fixed now I hope

Gregorius Techneticies 2 months ago
parent
commit
1deb1bb225
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 15
- 10
src/main/java/gregapi/block/fluid/BlockBaseFluid.java View File

@@ -186,6 +186,18 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
186 186
 	public int tryToFlowVerticallyInto(World aWorld, int aX, int aY, int aZ, int aAmount) {
187 187
 		if (aY <= 0 || aY+1 >= aWorld.getHeight()) return aWorld.setBlockToAir(aX, aY, aZ) ? 0 : aAmount;
188 188
 		
189
+		// First do the Water specific check.
190
+		if (mLighterThanWater) {
191
+			int tY = aY + 1;
192
+			Block tBlock = aWorld.getBlock(aX, tY, aZ);
193
+			if (tBlock instanceof BlockWaterlike || tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
194
+				aWorld.setBlock(aX, aY, aZ, tBlock, aWorld.getBlockMetadata(aX, tY, aZ), 3);
195
+				aWorld.setBlock(aX, tY, aZ, this, aAmount - 1, 3);
196
+				aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
197
+				return 0;
198
+			}
199
+		}
200
+		
189 201
 		// Compressed Fluid Blocks behave a little bit "jumpier" than normal ones. ;)
190 202
 		if (aAmount > 8) {
191 203
 			int tY = aY - densityDir;
@@ -259,16 +271,6 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
259 271
 			aWorld.setBlockToAir(aX, aY, aZ);
260 272
 			return 0;
261 273
 		}
262
-		if (mLighterThanWater) {
263
-			tY = aY + 1;
264
-			tBlock = aWorld.getBlock(aX, tY, aZ);
265
-			if (tBlock instanceof BlockWaterlike || tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
266
-				aWorld.setBlock(aX, aY, aZ, tBlock, aWorld.getBlockMetadata(aX, tY, aZ), 3);
267
-				aWorld.setBlock(aX, tY, aZ, this, aAmount - 1, 3);
268
-				aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
269
-				return 0;
270
-			}
271
-		}
272 274
 		return aAmount;
273 275
 	}
274 276
 	
@@ -296,8 +298,11 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
296 298
 	@Override public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aDirection) {return mFlammability;}
297 299
 	@Override public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aDirection) {return mFlammability;}
298 300
 	@Override public boolean canCollideCheck(int meta, boolean fullHit) {return fullHit && meta >= 7;}
301
+	@Override public boolean isNormalCube() {return F;}
299 302
 	@Override public boolean isOpaqueCube() {return F;}
300 303
 	@Override public boolean func_149730_j() {return F;}
304
+	@Override public boolean renderAsNormalBlock() {return F;}
305
+	@Override public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) {return F;}
301 306
 	@Override public int getRenderType() {return RendererBlockFluid.RENDER_ID;}
302 307
 	
303 308
 

+ 4
- 0
src/main/java/gregtech/blocks/fluids/BlockWaterlike.java View File

@@ -48,6 +48,7 @@ import net.minecraft.util.IIcon;
48 48
 import net.minecraft.util.Vec3;
49 49
 import net.minecraft.world.IBlockAccess;
50 50
 import net.minecraft.world.World;
51
+import net.minecraftforge.common.util.ForgeDirection;
51 52
 import net.minecraftforge.fluids.BlockFluidClassic;
52 53
 import net.minecraftforge.fluids.Fluid;
53 54
 import net.minecraftforge.fluids.FluidStack;
@@ -194,8 +195,11 @@ public abstract class BlockWaterlike extends BlockFluidClassic implements IBlock
194 195
 	@Override public boolean getTickRandomly() {return F;}
195 196
 	@Override public boolean canDisplace(IBlockAccess aWorld, int aX, int aY, int aZ) {return !aWorld.getBlock(aX, aY, aZ).getMaterial().isLiquid() && super.canDisplace(aWorld, aX, aY, aZ);}
196 197
 	@Override public boolean displaceIfPossible(World aWorld, int aX, int aY, int aZ) {return !aWorld.getBlock(aX, aY, aZ).getMaterial().isLiquid() && super.displaceIfPossible(aWorld, aX, aY, aZ);}
198
+	@Override public boolean isNormalCube() {return F;}
197 199
 	@Override public boolean isOpaqueCube() {return F;}
198 200
 	@Override public boolean func_149730_j() {return F;}
201
+	@Override public boolean renderAsNormalBlock() {return F;}
202
+	@Override public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) {return F;}
199 203
 	@Override public int getRenderType() {return RendererBlockFluid.RENDER_ID;}
200 204
 	
201 205
 	public BlockWaterlike addEffect(int aEffectID, int aEffectDuration, int aEffectLevel) {

Loading…
Cancel
Save