Browse Source

Oil should now behave better i nthe Water

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

+ 2
- 0
CHANGELOG.md View File

@@ -10,6 +10,7 @@ Nothing (I tend to only add finished Stuff to the Changelog).
10 10
 
11 11
 
12 12
 6.14.09: (Not released yet, released whenever it needs to be)
13
+[NOTE] The Default Config Pack updated to disable Fastcrafts Chunk Culling, so that Ocean Floors are now rendering properly again. Set "enableCullingTweaks" to false in the "config/fastcraft.ini" File, if you experience this Issue.
13 14
 [COMPAT] Aroma1997's Mining Dimension is now Compatible with my Worldgen.
14 15
 [FIXED] Infinite Worldgen Loop with Oceans, because I forgot to set the Block Update Flag to 2 during Worldgen, because ofcourse I left it to default when I fixed another Ocean related Bug...
15 16
 [FIXED] Railcraft Crowbars should now be able to remove Covers again, even if they dont use the overlay for technical reasons.
@@ -18,6 +19,7 @@ Nothing (I tend to only add finished Stuff to the Changelog).
18 19
 [FIXED] Chainsaws used WAY too much durability for Treecapitation!
19 20
 [FIXED] Worldgeneration in different Dimensions had the same RNG as on the Overworld. Now the Seed is being XOR-ed with the Dimension ID to prevent that. This has the convenient Side Effect of the Overworld staying the same as before, because it's ID is Zero.
20 21
 [CHANGED] Blue Steel is Red Steel now and vice versa. This should fix my ages old fuckup of the Recipes. Everything should still be the same as before when it comes to Stats, just the Color of the Material changed. If you used Matter Fabricators to make Red/Blue Steel for some reason, you may need to check the USB Stick with the Recipe.
22
+[CHANGED] Oil and Natural Gas can now pass through Water. In the case of Oil this will result in Buildcraft alike Oil Fountains or puddles in the Ocean, should you be super lucky. If not, just dig a tunnel down and it happens too. XD
21 23
 [ADDED] Barbecue Sauce (BBQ Sauce), because why not.
22 24
 [ADDED] Axes, Saws and Chainsaws can now place Saplings too. They will still place Workbenches if Saplings cant be placed.
23 25
 [ADDED] Tooltip for Covers that can be controlled with the Cover Controller Cover. In case of Covers where the Cover Controller Cover is required (such as Shutter Cover), it will be Cyan instead of Dark Gray to make it easier to see.

+ 28
- 12
src/main/java/gregapi/block/fluid/BlockBaseFluid.java View File

@@ -38,13 +38,11 @@ import gregapi.tileentity.data.ITileEntitySurface;
38 38
 import gregapi.util.ST;
39 39
 import gregapi.util.UT;
40 40
 import gregapi.util.WD;
41
-import gregtech.blocks.fluids.BlockWaterlike;
42 41
 import net.minecraft.block.Block;
43 42
 import net.minecraft.block.material.Material;
44 43
 import net.minecraft.client.renderer.texture.IIconRegister;
45 44
 import net.minecraft.entity.Entity;
46 45
 import net.minecraft.entity.EntityLivingBase;
47
-import net.minecraft.init.Blocks;
48 46
 import net.minecraft.item.ItemBlock;
49 47
 import net.minecraft.potion.PotionEffect;
50 48
 import net.minecraft.tileentity.TileEntity;
@@ -188,13 +186,31 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
188 186
 		
189 187
 		// First do the Water specific check.
190 188
 		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;
189
+			int tY = aY;
190
+			while (++tY < aWorld.getHeight() && WD.anywater(aWorld, aX, tY, aZ));
191
+			if (tY-1 > aY) {
192
+				Block tBlock = aWorld.getBlock(aX, tY, aZ);
193
+				if (tBlock == this) {
194
+					int tAmount = 1 + aWorld.getBlockMetadata(aX, tY, aZ) + aAmount;
195
+					if (tAmount > 16) {
196
+						aWorld.setBlock(aX, tY, aZ, this, 16 - 1, 3);
197
+						aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
198
+						return tAmount - 16;
199
+					}
200
+					if (tAmount > 0) {
201
+						aWorld.setBlock(aX, tY, aZ, this, tAmount - 1, 3);
202
+						// Called by the Block Update caused by setBlockToAir
203
+						// aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
204
+						aWorld.setBlockToAir(aX, aY, aZ);
205
+						return 0;
206
+					}
207
+					return aAmount;
208
+				}
209
+				if (WD.air(aWorld, aX, tY, aZ, tBlock) || displaceIfPossible(aWorld, aX, tY, aZ)) {
210
+					aWorld.setBlock(aX, tY, aZ, this, aAmount - 1, 3);
211
+					aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
212
+					return 0;
213
+				}
198 214
 			}
199 215
 		}
200 216
 		
@@ -213,14 +229,14 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
213 229
 				return 0;
214 230
 			}
215 231
 			// Swap with GT6 Water Blocks.
216
-			if (tBlock instanceof BlockWaterlike || tBlock == Blocks.water || tBlock == Blocks.flowing_water) {
232
+			if (WD.anywater(tBlock)) {
217 233
 				aWorld.setBlock(aX, aY, aZ, tBlock, aWorld.getBlockMetadata(aX, tY, aZ), 3);
218 234
 				aWorld.setBlock(aX, tY, aZ, this, aAmount - 1, 3);
219 235
 				aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);
220 236
 				return 0;
221 237
 			}
222 238
 			// Lets just jump up! Make a Fountain!
223
-			if (tBlock == NB || displaceIfPossible(aWorld, aX, tY, aZ)) {
239
+			if (WD.air(aWorld, aX, tY, aZ, tBlock) || displaceIfPossible(aWorld, aX, tY, aZ)) {
224 240
 				// The Block left behind should stay for a bit.
225 241
 				aWorld.scheduleBlockUpdate(aX, aY, aZ, this, 128 - aAmount * 4);
226 242
 				// All but one Quanta will move up!
@@ -264,7 +280,7 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
264 280
 			}
265 281
 			return aAmount;
266 282
 		}
267
-		if (tBlock == NB || displaceIfPossible(aWorld, aX, tY, aZ)) {
283
+		if (WD.air(aWorld, aX, tY, aZ, tBlock) || displaceIfPossible(aWorld, aX, tY, aZ)) {
268 284
 			aWorld.setBlock(aX, tY, aZ, this, aAmount - 1, 3);
269 285
 			// Called by the Block Update caused by setBlockToAir
270 286
 			// aWorld.scheduleBlockUpdate(aX, tY, aZ, this, tickRate);

+ 3
- 3
src/main/java/gregtech/tileentity/misc/MultiTileEntityFluidSpring.java View File

@@ -39,7 +39,7 @@ import gregapi.render.ITexture;
39 39
 import gregapi.tileentity.base.TileEntityBase04MultiTileEntities;
40 40
 import gregapi.tileentity.data.ITileEntitySurface;
41 41
 import gregapi.util.UT;
42
-import gregtech.blocks.fluids.BlockWaterlike;
42
+import gregapi.util.WD;
43 43
 import net.minecraft.block.Block;
44 44
 import net.minecraft.init.Blocks;
45 45
 import net.minecraft.nbt.NBTTagCompound;
@@ -105,7 +105,7 @@ public class MultiTileEntityFluidSpring extends TileEntityBase04MultiTileEntitie
105 105
 				if (tBlock instanceof BlockFluidFinite) {
106 106
 					if (tAbove == tBlock) {
107 107
 						worldObj.setBlock(xCoord, yCoord+1, zCoord, tBlock, UT.Code.bind4(getMetaDataAtSide(SIDE_UP)+8), 3);
108
-					} else if (tAbove instanceof BlockWaterlike || tAbove.isAir(worldObj, xCoord, yCoord+1, zCoord)) {
108
+					} else if (WD.anywater(tAbove) || tAbove.isAir(worldObj, xCoord, yCoord+1, zCoord)) {
109 109
 						worldObj.setBlock(xCoord, yCoord+1, zCoord, tBlock, 7, 3);
110 110
 					}
111 111
 				} else {
@@ -126,7 +126,7 @@ public class MultiTileEntityFluidSpring extends TileEntityBase04MultiTileEntitie
126 126
 						} else {
127 127
 							worldObj.setBlock(xCoord, yCoord+1, zCoord, tBlock, 0, 3);
128 128
 						}
129
-					} else if (tAbove instanceof BlockWaterlike || tAbove.isAir(worldObj, xCoord, yCoord+1, zCoord)) {
129
+					} else if (WD.anywater(tAbove) || tAbove.isAir(worldObj, xCoord, yCoord+1, zCoord)) {
130 130
 						worldObj.setBlock(xCoord, yCoord+1, zCoord, tBlock, 0, 3);
131 131
 					}
132 132
 				}

Loading…
Cancel
Save