From 70755b5265f044718cd697de94f10c79a1d2671b Mon Sep 17 00:00:00 2001
From: boubou_19 <miisterunknown@gmail.com>
Date: Mon, 29 Nov 2021 12:31:58 +0100
Subject: added pollution config for single blocks

---
 .../generators/GregtechRocketFuelGeneratorBase.java     | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

(limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations')

diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
index 6e33529b66..885069693d 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -13,6 +13,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
 import gregtech.api.util.GT_Utility;
 import gtPlusPlus.core.lib.CORE;
 import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
 import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
 import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.init.Blocks;
@@ -22,13 +23,18 @@ import net.minecraftforge.fluids.FluidStack;
 public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank {
 
 	private boolean useFuel = false;
+	protected int pollMin, pollMax;
 
 	public GregtechRocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final ITexture... aTextures) {
 		super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+		int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+		int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
 	}
 
 	public GregtechRocketFuelGeneratorBase(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) {
 		super(aName, aTier, 3, aDescription, aTextures);
+		int pollMin = (int)(CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
+		int pollMax = (int)(CORE.ConfigSwitches.baseMaxPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]);
 	}
 
 	@Override
@@ -56,8 +62,7 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
 
 
 	@Override
-	public String[] getDescription() {		
-		if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+	public String[] getDescription() {
 			int pollMin = mTier == 4 ? 250 : (mTier == 5 ? 500 : 750);
 			int pollMax = mTier == 4 ? 2000 : (mTier == 5 ? 4000 : 6000);			
 			String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second";			
@@ -65,10 +70,6 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
 					this.mDescription,
 					"Fuel Efficiency: " + this.getEfficiency() + "%",
 					aPollution};
-		}		
-		return new String[]{
-				this.mDescription,
-				"Fuel Efficiency: " + this.getEfficiency() + "%"};
 	}
 
 
@@ -292,7 +293,9 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
 		}
 	}
 
-	public abstract int getPollution();
+	public int getPollution() {
+		return  MathUtils.randInt(pollMin, pollMax);
+	}
 
 	public abstract GT_Recipe_Map getRecipes();
 
-- 
cgit