diff options
author | boubou_19 <miisterunknown@gmail.com> | 2021-11-29 12:31:58 +0100 |
---|---|---|
committer | boubou_19 <miisterunknown@gmail.com> | 2021-11-29 12:31:58 +0100 |
commit | 70755b5265f044718cd697de94f10c79a1d2671b (patch) | |
tree | 47bb4a91b3505f9921be1bd43cd6337164b19dc5 /src | |
parent | 31d35697523be7d9426b74b7e3f4c38e4a85f432 (diff) | |
download | GT5-Unofficial-70755b5265f044718cd697de94f10c79a1d2671b.tar.gz GT5-Unofficial-70755b5265f044718cd697de94f10c79a1d2671b.tar.bz2 GT5-Unofficial-70755b5265f044718cd697de94f10c79a1d2671b.zip |
added pollution config for single blocks
Diffstat (limited to 'src')
7 files changed, 36 insertions, 27 deletions
diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java index c97df0a4c6..7c1b584d87 100644 --- a/src/Java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java @@ -232,6 +232,15 @@ public class ConfigHandler { pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter,"pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler,"pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler); pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond,"pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond); + basePollutionPerSecondSemiFluidGenerator = config.get("pollution", "basePollutionPerSecondSemiFluidGenerator", basePollutionPerSecondSemiFluidGenerator, "base pollution rate in gibbl/s for the single block semi fluid generators").getInt(basePollutionPerSecondSemiFluidGenerator); + pollutionReleasedByTierSemiFluidGenerator = config.get("pollution", "pollutionReleasedByTierSemiFluidGenerator", pollutionReleasedByTierSemiFluidGenerator, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList(); + basePollutionPerSecondBoiler = config.get("pollution", "basePollutionPerSecondBoiler", basePollutionPerSecondBoiler,"base pollution rate in gibbl/s for the single block boilers").getInt(basePollutionPerSecondBoiler); + pollutionReleasedByTierBoiler = config.get("pollution", "pollutionReleasedByTierBoiler", pollutionReleasedByTierBoiler, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList(); + baseMinPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMinPollutionPerSecondRocketFuelGenerator", baseMinPollutionPerSecondRocketFuelGenerator, "minimum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMinPollutionPerSecondRocketFuelGenerator); + baseMaxPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMaxPollutionPerSecondRocketFuelGenerator", baseMaxPollutionPerSecondRocketFuelGenerator, "maximum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMaxPollutionPerSecondRocketFuelGenerator); + pollutionReleasedByTierRocketFuelGenerator = config.get("pollution", "pollutionReleasedByTierRocketFuelGenerator", pollutionReleasedByTierRocketFuelGenerator, "coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)").getDoubleList(); + basePollutionPerSecondGeothermalGenerator = config.get("pollution", "basePollutionPerSecondGeothermalGenerator", basePollutionPerSecondGeothermalGenerator,"base pollution rate in gibbl/s for the geothermal engines").getInt(basePollutionPerSecondGeothermalGenerator); + pollutionReleasedByTierGeothermalGenerator = config.get("pollution", "pollutionReleasedByTierGeothermalGenerator", pollutionReleasedByTierGeothermalGenerator, "coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)").getDoubleList(); config.save(); } diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 71486b1ac5..5003eaab7f 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -302,14 +302,16 @@ public class CORE { public static int pollutionPerSecondMultiAutoCrafter = 500; public static int pollutionPerSecondMultiThermalBoiler = 700; public static int pollutionPerSecondMultiAlgaePond = 0; - - - - - - - - + //pollution single blocks + public static int basePollutionPerSecondSemiFluidGenerator = 40; + public static double[] pollutionReleasedByTierSemiFluidGenerator = new double[]{0,2.0,4.0,8.0}; + public static int basePollutionPerSecondBoiler = 35; + public static double[] pollutionReleasedByTierBoiler = new double[]{0,1.0,1.43, 1.86}; + public static int baseMinPollutionPerSecondRocketFuelGenerator = 250; + public static int baseMaxPollutionPerSecondRocketFuelGenerator = 2000; + public static double[] pollutionReleasedByTierRocketFuelGenerator = new double[]{0,0,0,0,1,2,3}; + public static int basePollutionPerSecondGeothermalGenerator = 100; + public static double[] pollutionReleasedByTierGeothermalGenerator = new double[]{0,0,0,0,1,1,1}; } 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(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index 706b8844c1..b38cff5e19 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -235,7 +235,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override protected int getPollution() { - return 20 + (15 * tier); + return (int) (CORE.ConfigSwitches.basePollutionPerSecondBoiler*CORE.ConfigSwitches.pollutionReleasedByTierBoiler[this.tier]); } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index d5a1d8d355..1ace02ce3a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -16,11 +16,11 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator { - public static final int BASE_POLLUTION = 2; public int mEfficiency; /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { @@ -41,7 +41,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi } public int getPollution() { - return (int) (2.0D * Math.pow(2.0D, this.mTier)); + return (int) (CORE.ConfigSwitches.basePollutionPerSecondSemiFluidGenerator * CORE.ConfigSwitches.pollutionReleasedByTierSemiFluidGenerator[this.mTier]); } @Override @@ -67,7 +67,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[]{this.mDescription, "Produces "+(this.getPollution()*20)+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%"}; + return new String[]{this.mDescription, "Produces "+(this.getPollution())+" pollution/sec", "Fuel Efficiency: "+this.getEfficiency() + "%"}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index cfbf7bd487..a3c882a4af 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -38,7 +38,7 @@ extends GT_MetaTileEntity_BasicGenerator @Override public String[] getDescription() { - String aPollution = "Causes between "+this.getPollution()+ " Pollution per second"; + String aPollution = "Causes "+this.getPollution()+ " Pollution per second"; return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", aPollution}; } @@ -142,6 +142,6 @@ extends GT_MetaTileEntity_BasicGenerator } public int getPollution() { - return 100; + return (int) (CORE.ConfigSwitches.basePollutionPerSecondGeothermalGenerator * CORE.ConfigSwitches.pollutionReleasedByTierGeothermalGenerator[mTier]); } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index f9bf116362..c05c7ae3ff 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -12,6 +12,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GTPP_Recipe; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -138,10 +139,4 @@ extends GregtechRocketFuelGeneratorBase { public ITexture[] getSidesActive(final byte aColor) { return new ITexture[]{super.getSidesActive(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active)}; } - - public int getPollution() { - int pollMin = mTier == 4 ? 250 : (mTier == 5 ? 500 : 750); - int pollMax = mTier == 4 ? 2000 : (mTier == 5 ? 4000 : 6000); - return (int) (MathUtils.randInt(pollMin, pollMax)/20); - } } |