Browse Source

May fix the Issue with Oil and Natural Gas causing Worldgen Loops

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

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

@@ -131,10 +131,10 @@ public class BlockBaseFluid extends BlockFluidFinite implements IBlock, IItemGT,
131 131
 			return;
132 132
 		}
133 133
 		
134
-		if (displaceIfPossible(aWorld, aX  , aY, aZ-1)) aWorld.setBlockToAir(aX  , aY, aZ-1);
135
-		if (displaceIfPossible(aWorld, aX  , aY, aZ+1)) aWorld.setBlockToAir(aX  , aY, aZ+1);
136
-		if (displaceIfPossible(aWorld, aX-1, aY, aZ  )) aWorld.setBlockToAir(aX-1, aY, aZ  );
137
-		if (displaceIfPossible(aWorld, aX+1, aY, aZ  )) aWorld.setBlockToAir(aX+1, aY, aZ  );
134
+		if (aWorld.blockExists(aX  , aY, aZ-1) && displaceIfPossible(aWorld, aX  , aY, aZ-1)) aWorld.setBlockToAir(aX  , aY, aZ-1);
135
+		if (aWorld.blockExists(aX  , aY, aZ+1) && displaceIfPossible(aWorld, aX  , aY, aZ+1)) aWorld.setBlockToAir(aX  , aY, aZ+1);
136
+		if (aWorld.blockExists(aX-1, aY, aZ  ) && displaceIfPossible(aWorld, aX-1, aY, aZ  )) aWorld.setBlockToAir(aX-1, aY, aZ  );
137
+		if (aWorld.blockExists(aX+1, aY, aZ  ) && displaceIfPossible(aWorld, aX+1, aY, aZ  )) aWorld.setBlockToAir(aX+1, aY, aZ  );
138 138
 		
139 139
 		int tTotal = tRemainingQuanta, tCount = 1;
140 140
 		

+ 1
- 1
src/main/java/gregapi/data/CS.java View File

@@ -1380,7 +1380,7 @@ public class CS {
1380 1380
 				try {aNBT = CompressedStreamTools.read(aTargetFile);} catch (Throwable e) {e.printStackTrace(ERR);}
1381 1381
 				for (int i = 0; i < Integer.MAX_VALUE; i++) {
1382 1382
 					if (!aNBT.hasKey(""+i)) break;
1383
-					FluidTankGT tTank = new FluidTankGT(Long.MAX_VALUE).setPreventDraining().setVoidExcess();
1383
+					FluidTankGT tTank = new FluidTankGT().setPreventDraining().setVoidExcess();
1384 1384
 					tTank.readFromNBT(aNBT, ""+i);
1385 1385
 					if (!tTank.has()) continue;
1386 1386
 					GARBAGE_FLUIDS.add(tTank);

+ 2
- 2
src/main/java/gregapi/tileentity/machines/MultiTileEntityBasicMachine.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
  *
@@ -170,7 +170,7 @@ public class MultiTileEntityBasicMachine extends TileEntityBase09FacingSingle im
170 170
 		mTanksInput = new FluidTankGT[mRecipes.mInputFluidCount];
171 171
 		for (int i = 0; i < mTanksInput.length; i++) mTanksInput[i] = new FluidTankGT(tCapacity).setCapacity(mRecipes, mParallel * 2L).readFromNBT(aNBT, NBT_TANK+".in."+i);
172 172
 		mTanksOutput = new FluidTankGT[mRecipes.mOutputFluidCount];
173
-		for (int i = 0; i < mTanksOutput.length; i++) mTanksOutput[i] = new FluidTankGT(Long.MAX_VALUE).readFromNBT(aNBT, NBT_TANK+".out."+i);
173
+		for (int i = 0; i < mTanksOutput.length; i++) mTanksOutput[i] = new FluidTankGT().readFromNBT(aNBT, NBT_TANK+".out."+i);
174 174
 		
175 175
 		mOutputFluids = new FluidStack[mRecipes.mOutputFluidCount];
176 176
 		for (int i = 0; i < mOutputFluids.length; i++) mOutputFluids[i] = FL.load(aNBT, NBT_TANK_OUT+"."+i);

+ 2
- 2
src/main/java/gregtech/tileentity/energy/converters/MultiTileEntityTurbineSteam.java View File

@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (c) 2019 Gregorius Techneticies
2
+ * Copyright (c) 2021 GregTech-6 Team
3 3
  *
4 4
  * This file is part of GregTech.
5 5
  *
@@ -44,7 +44,7 @@ import net.minecraftforge.fluids.IFluidHandler;
44 44
 import net.minecraftforge.fluids.IFluidTank;
45 45
 
46 46
 public class MultiTileEntityTurbineSteam extends TileEntityBase11Motor implements IFluidHandler {
47
-	public FluidTankGT mTank = new FluidTankGT(Integer.MAX_VALUE);
47
+	public FluidTankGT mTank = new FluidTankGT();
48 48
 	public long mSteamCounter = 0, mEnergyProducedNextTick = 0;
49 49
 	public static final int STEAM_PER_WATER = 200;
50 50
 	

+ 2
- 2
src/main/java/gregtech/tileentity/energy/generators/MultiTileEntityGeneratorHotFluid.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
  *
@@ -69,7 +69,7 @@ public class MultiTileEntityGeneratorHotFluid extends TileEntityBase09FacingSing
69 69
 	public TagData mEnergyTypeEmitted = TD.Energy.HU;
70 70
 	public RecipeMap mRecipes = FM.Hot;
71 71
 	public Recipe mLastRecipe = null;
72
-	public FluidTankGT[] mTanks = {new FluidTankGT(1000), new FluidTankGT(Long.MAX_VALUE)};
72
+	public FluidTankGT[] mTanks = {new FluidTankGT(1000), new FluidTankGT()};
73 73
 	public TE_Behavior_Active_Trinary mActivity = null;
74 74
 	
75 75
 	@Override

+ 3
- 3
src/main/java/gregtech/tileentity/inventories/MultiTileEntityEnderGarbageBin.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
  *
@@ -77,7 +77,7 @@ public class MultiTileEntityEnderGarbageBin extends TileEntityBase07Paintable im
77 77
 	@Override
78 78
 	protected IFluidTank getFluidTankFillable2(byte aSide, FluidStack aFluidToFill) {
79 79
 		for (int i = 0; i < GarbageGT.GARBAGE_FLUIDS.size(); i++) if (GarbageGT.GARBAGE_FLUIDS.get(i).contains(aFluidToFill)) return GarbageGT.GARBAGE_FLUIDS.get(i);
80
-		FluidTankGT tTank = new FluidTankGT(Long.MAX_VALUE).setPreventDraining().setVoidExcess();
80
+		FluidTankGT tTank = new FluidTankGT().setPreventDraining().setVoidExcess();
81 81
 		GarbageGT.GARBAGE_FLUIDS.add(tTank);
82 82
 		return tTank;
83 83
 	}
@@ -89,7 +89,7 @@ public class MultiTileEntityEnderGarbageBin extends TileEntityBase07Paintable im
89 89
 	
90 90
 	@Override
91 91
 	protected IFluidTank[] getFluidTanks2(byte aSide) {
92
-		return GarbageGT.GARBAGE_FLUIDS.isEmpty() ? new FluidTankGT(Long.MAX_VALUE).AS_ARRAY : GarbageGT.GARBAGE_FLUIDS.toArray(ZL_FT);
92
+		return GarbageGT.GARBAGE_FLUIDS.isEmpty() ? new FluidTankGT().AS_ARRAY : GarbageGT.GARBAGE_FLUIDS.toArray(ZL_FT);
93 93
 	}
94 94
 	
95 95
 	@Override

+ 2
- 2
src/main/java/gregtech/tileentity/inventories/MultiTileEntityEnderGarbageDump.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
  *
@@ -94,7 +94,7 @@ public class MultiTileEntityEnderGarbageDump extends TileEntityBase07Paintable i
94 94
 	
95 95
 	@Override
96 96
 	protected IFluidTank[] getFluidTanks2(byte aSide) {
97
-		return GarbageGT.GARBAGE_FLUIDS.isEmpty() ? new FluidTankGT(Long.MAX_VALUE).AS_ARRAY : GarbageGT.GARBAGE_FLUIDS.toArray(ZL_FT);
97
+		return GarbageGT.GARBAGE_FLUIDS.isEmpty() ? new FluidTankGT().AS_ARRAY : GarbageGT.GARBAGE_FLUIDS.toArray(ZL_FT);
98 98
 	}
99 99
 	
100 100
 	@Override

+ 2
- 2
src/main/java/gregtech/tileentity/multiblocks/MultiTileEntityLargeHeatExchanger.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
  *
@@ -58,7 +58,7 @@ public class MultiTileEntityLargeHeatExchanger extends TileEntityBase10MultiBloc
58 58
 	public TagData mEnergyTypeEmitted = TD.Energy.HU;
59 59
 	public RecipeMap mRecipes = FM.Hot;
60 60
 	public Recipe mLastRecipe = null;
61
-	public FluidTankGT[] mTanks = {new FluidTankGT(10000), new FluidTankGT(Long.MAX_VALUE)};
61
+	public FluidTankGT[] mTanks = {new FluidTankGT(10000), new FluidTankGT()};
62 62
 	public TE_Behavior_Active_Trinary mActivity = null;
63 63
 	
64 64
 	@Override

Loading…
Cancel
Save