Browse Source

This MIGHT have done something about Worldgen Loops for Oceans

Gregorius Techneticies 2 months ago
parent
commit
5fa93bc22d
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F
1 changed files with 8 additions and 12 deletions
  1. 8
    12
      src/main/java/gregtech/blocks/fluids/BlockWaterlike.java

+ 8
- 12
src/main/java/gregtech/blocks/fluids/BlockWaterlike.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2020 GregTech-6 Team
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -118,21 +118,17 @@ public abstract class BlockWaterlike extends BlockFluidClassic implements IBlock
118 118
 		
119 119
 		
120 120
 		if (canDisplace(aWorld, aX, aY+densityDir, aZ)) {
121
-			flowIntoBlock(aWorld, aX, aY+densityDir, aZ, 1);
121
+			if (displaceIfPossible(aWorld, aX, aY+densityDir, aZ)) aWorld.setBlock(aX, aY+densityDir, aZ, this, 1, 3);
122 122
 			return;
123 123
 		}
124 124
 		
125
-		int flowMeta = quantaPerBlock - quantaRemaining + 1;
126
-		if (flowMeta >= quantaPerBlock) return;
125
+		int tFlowMeta  = (aWorld.getBlock(aX, aY-densityDir, aZ) instanceof BlockWaterlike ? 1 : quantaPerBlock - quantaRemaining + 1);
126
+		if (tFlowMeta >= quantaPerBlock) return;
127 127
 		
128
-		if (isSourceBlock(aWorld, aX, aY, aZ) || !isFlowingVertically(aWorld, aX, aY, aZ)) {
129
-			if (aWorld.getBlock(aX, aY-densityDir, aZ) instanceof BlockWaterlike) flowMeta = 1;
130
-			boolean flowTo[] = getOptimalFlowDirections(aWorld, aX, aY, aZ);
131
-			if (flowTo[0]) flowIntoBlock(aWorld, aX-1, aY, aZ  , flowMeta);
132
-			if (flowTo[1]) flowIntoBlock(aWorld, aX+1, aY, aZ  , flowMeta);
133
-			if (flowTo[2]) flowIntoBlock(aWorld, aX  , aY, aZ-1, flowMeta);
134
-			if (flowTo[3]) flowIntoBlock(aWorld, aX  , aY, aZ+1, flowMeta);
135
-		}
128
+		if (aWorld.blockExists(aX  , aY, aZ-1) && displaceIfPossible(aWorld, aX  , aY, aZ-1)) aWorld.setBlock(aX  , aY, aZ-1, this, tFlowMeta, 3);
129
+		if (aWorld.blockExists(aX  , aY, aZ+1) && displaceIfPossible(aWorld, aX  , aY, aZ+1)) aWorld.setBlock(aX  , aY, aZ+1, this, tFlowMeta, 3);
130
+		if (aWorld.blockExists(aX-1, aY, aZ  ) && displaceIfPossible(aWorld, aX-1, aY, aZ  )) aWorld.setBlock(aX-1, aY, aZ  , this, tFlowMeta, 3);
131
+		if (aWorld.blockExists(aX+1, aY, aZ  ) && displaceIfPossible(aWorld, aX+1, aY, aZ  )) aWorld.setBlock(aX+1, aY, aZ  , this, tFlowMeta, 3);
136 132
 	}
137 133
 	
138 134
 	@Override

Loading…
Cancel
Save