diff --git a/src/main/java/tectech/TecTech.java b/src/main/java/tectech/TecTech.java index 4f3dc3428dd..1c30594c0f1 100644 --- a/src/main/java/tectech/TecTech.java +++ b/src/main/java/tectech/TecTech.java @@ -2,6 +2,9 @@ import net.minecraftforge.common.MinecraftForge; +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.ConfigurationManager; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; @@ -9,12 +12,11 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import eu.usrv.yamcore.auxiliary.IngameErrorLog; import eu.usrv.yamcore.auxiliary.LogHelper; import gregtech.api.enums.Mods; import gregtech.api.objects.XSTR; +import tectech.loader.ConfigHandler; import tectech.loader.MainLoader; -import tectech.loader.TecTechConfig; import tectech.loader.gui.CreativeTabTecTech; import tectech.loader.thing.MuTeLoader; import tectech.mechanics.enderStorage.EnderWorldSavedData; @@ -26,6 +28,7 @@ modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, + guiFactory = "tectech.loader.gui.TecTechGUIFactory", dependencies = "required-after:Forge@[10.13.4.1614,);" + "required-after:YAMCore@[0.5.70,);" + "required-after:structurelib;" + "after:ComputerCraft;" @@ -38,6 +41,13 @@ + "after:Thaumcraft;") public class TecTech { + static { + try { + ConfigurationManager.registerConfig(ConfigHandler.class); + } catch (ConfigException e) { + throw new RuntimeException(e); + } + } @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE) public static CommonProxy proxy; @@ -48,8 +58,6 @@ public class TecTech { public static final LogHelper LOGGER = new LogHelper(Reference.MODID); public static CreativeTabTecTech creativeTabTecTech; - public static TecTechConfig configTecTech; - public static EnderWorldSavedData enderWorldSavedData; /** @@ -64,21 +72,6 @@ public class TecTech { public void PreLoad(FMLPreInitializationEvent PreEvent) { LOGGER.setDebugOutput(true); - configTecTech = new TecTechConfig( - PreEvent.getModConfigurationDirectory(), - Reference.COLLECTIONNAME, - Reference.MODID); - - if (!configTecTech.LoadConfig()) { - LOGGER.error(Reference.MODID + " could not load its config file. Things are going to be weird!"); - } - - if (configTecTech.MOD_ADMIN_ERROR_LOGS) { - LOGGER.setDebugOutput(TecTechConfig.DEBUG_MODE); - LOGGER.debug("moduleAdminErrorLogs is enabled"); - IngameErrorLog moduleAdminErrorLogs = new IngameErrorLog(); - } - enderWorldSavedData = new EnderWorldSavedData(); FMLCommonHandler.instance() .bus() @@ -97,7 +90,6 @@ public void Load(FMLInitializationEvent event) { hasCOFH = Mods.COFHCore.isModLoaded(); MainLoader.load(); - MainLoader.addAfterGregTechPostLoadRunner(); } @Mod.EventHandler diff --git a/src/main/java/tectech/loader/ConfigHandler.java b/src/main/java/tectech/loader/ConfigHandler.java new file mode 100644 index 00000000000..e360b5f6714 --- /dev/null +++ b/src/main/java/tectech/loader/ConfigHandler.java @@ -0,0 +1,61 @@ +package tectech.loader; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.TECTECH, filename = "tectech") +@Config.LangKeyPattern(pattern = "GT5U.gui.config.%cat.%field", fullyQualified = true) +@Config.RequiresMcRestart +public class ConfigHandler { + + public static Debug debug = new Debug(); + public static TeslaTweaks teslaTweaks = new TeslaTweaks(); + + @Config.Comment("Debug section") + public static class Debug { + + @Config.Comment("Enables logging and other purely debug features") + @Config.DefaultBoolean(false) + public boolean DEBUG_MODE; + } + + @Config.Comment("Tesla tweaks section") + public static class TeslaTweaks { + + @Config.Ignore() + public static final float TESLA_MULTI_LOSS_FACTOR_OVERDRIVE = 0.25f; + @Config.Ignore() + public static final int TESLA_MULTI_LOSS_PER_BLOCK_T0 = 1; + @Config.Ignore() + public static final int TESLA_MULTI_LOSS_PER_BLOCK_T1 = 1; + @Config.Ignore() + public static final int TESLA_MULTI_LOSS_PER_BLOCK_T2 = 1; + @Config.Ignore() + public static final int TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM = 100; + @Config.Ignore() + public static final int TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN = 50; + @Config.Ignore() + public static final int TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON = 50; + @Config.Ignore() + public static final int TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1 = 2; + @Config.Ignore() + public static final int TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2 = 4; + @Config.Ignore() + public static final int TESLA_MULTI_RANGE_COVER = 16; + @Config.Ignore() + public static final int TESLA_MULTI_RANGE_TOWER = 32; + @Config.Ignore() + public static final int TESLA_MULTI_RANGE_TRANSCEIVER = 16; + @Config.Ignore() + public static final float TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE = 0.25f; + @Config.Ignore() + public static final int TESLA_SINGLE_LOSS_PER_BLOCK = 1; + + @Config.Ignore() + public static final int TESLA_SINGLE_RANGE = 20; + @Config.Comment("Set true to enable the cool visual effect when tesla tower running.") + @Config.DefaultBoolean(true) + public boolean TESLA_VISUAL_EFFECT; + } +} diff --git a/src/main/java/tectech/loader/MainLoader.java b/src/main/java/tectech/loader/MainLoader.java index 801653ca4b1..ab687fbbf9c 100644 --- a/src/main/java/tectech/loader/MainLoader.java +++ b/src/main/java/tectech/loader/MainLoader.java @@ -1,26 +1,14 @@ package tectech.loader; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; -import static gregtech.api.enums.Mods.TwilightForest; import static tectech.TecTech.LOGGER; -import static tectech.TecTech.configTecTech; import static tectech.TecTech.creativeTabTecTech; import static tectech.TecTech.proxy; -import static tectech.loader.TecTechConfig.DEBUG_MODE; - -import java.util.HashMap; import net.minecraft.block.Block; import net.minecraft.util.DamageSource; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; import cpw.mods.fml.common.ProgressManager; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTechAPI; -import gregtech.api.enums.Materials; -import gregtech.api.recipe.RecipeMaps; -import gregtech.api.util.GTRecipe; import tectech.TecTech; import tectech.loader.gui.CreativeTabTecTech; import tectech.loader.recipe.BaseRecipeLoader; @@ -80,7 +68,7 @@ public static void load() { } public static void postLoad() { - ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 4); + ProgressManager.ProgressBar progressBarPostLoad = ProgressManager.push("TecTech Post Loader", 2); progressBarPostLoad.step("Dreamcraft Compatibility"); if (NewHorizonsCoreMod.isModLoaded()) { @@ -100,104 +88,6 @@ public static void postLoad() { progressBarPostLoad.step("Recipes"); new BaseRecipeLoader().run(); TecTech.LOGGER.info("Recipe Init Done"); - - if (!configTecTech.DISABLE_BLOCK_HARDNESS_NERF) { - progressBarPostLoad.step("Nerf blocks blast resistance"); - adjustTwilightBlockResistance(); - TecTech.LOGGER.info("Blocks nerf done"); - } else { - progressBarPostLoad.step("Do not nerf blocks blast resistance"); - TecTech.LOGGER.info("Blocks were not nerfed"); - } - - // ProgressManager.pop(progressBarPostLoad); - } - - public static void addAfterGregTechPostLoadRunner() { - GregTechAPI.sAfterGTPostload.add(() -> { - if (TecTech.configTecTech.NERF_FUSION) { - FixBrokenFusionRecipes(); - } - }); - } - - private static void FixBrokenFusionRecipes() { - HashMap binds = new HashMap<>(); - for (Materials material : Materials.values()) { - FluidStack p = material.getPlasma(1); - if (p != null) { - if (DEBUG_MODE) { - LOGGER.info("Found Plasma of " + material.mName); - } - if (material.mElement != null && (material.mElement.mProtons >= Materials.Iron.mElement.mProtons - || -material.mElement.mProtons >= Materials.Iron.mElement.mProtons - || material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons - || -material.mElement.mNeutrons >= Materials.Iron.mElement.mNeutrons)) { - if (DEBUG_MODE) { - LOGGER.info("Attempting to bind " + material.mName); - } - if (material.getMolten(1) != null) { - binds.put( - p.getFluid(), - material.getMolten(1) - .getFluid()); - } else if (material.getGas(1) != null) { - binds.put( - p.getFluid(), - material.getGas(1) - .getFluid()); - } else if (material.getFluid(1) != null) { - binds.put( - p.getFluid(), - material.getFluid(1) - .getFluid()); - } else { - binds.put( - p.getFluid(), - Materials.Iron.getMolten(1) - .getFluid()); - } - } - } - } - for (GTRecipe r : RecipeMaps.fusionRecipes.getAllRecipes()) { - Fluid fluid = binds.get(r.mFluidOutputs[0].getFluid()); - if (fluid != null) { - if (DEBUG_MODE) { - LOGGER.info("Nerfing Recipe " + r.mFluidOutputs[0].getUnlocalizedName()); - } - r.mFluidOutputs[0] = new FluidStack(fluid, r.mFluidOutputs[0].amount); - } - fluid = binds.get(r.mFluidInputs[0].getFluid()); - if (fluid != null) { - if (DEBUG_MODE) { - LOGGER.info("Fixing plasma use in Recipe " + r.mFluidInputs[0].getUnlocalizedName()); - } - r.mFluidInputs[0] = new FluidStack(fluid, r.mFluidInputs[0].amount); - } - fluid = binds.get(r.mFluidInputs[1].getFluid()); - if (fluid != null) { - if (DEBUG_MODE) { - LOGGER.info("Fixing plasma use in Recipe " + r.mFluidInputs[1].getUnlocalizedName()); - } - r.mFluidInputs[1] = new FluidStack(fluid, r.mFluidInputs[1].amount); - } - } - } - - private static void safeSetResistance(Block block, float resistance) { - if (block != null) { - block.setResistance(resistance); - } - } - - private static void adjustTwilightBlockResistance() { - if (TwilightForest.isModLoaded()) { - safeSetResistance(GameRegistry.findBlock("TwilightForest", "tile.TFShield"), 30); - safeSetResistance(GameRegistry.findBlock("TwilightForest", "tile.TFThorns"), 10); - safeSetResistance(GameRegistry.findBlock("TwilightForest", "tile.TFTowerTranslucent"), 30); - safeSetResistance(GameRegistry.findBlock("TwilightForest", "tile.TFDeadrock"), 5); - } } public static void onLoadCompleted() { diff --git a/src/main/java/tectech/loader/TecTechConfig.java b/src/main/java/tectech/loader/TecTechConfig.java deleted file mode 100644 index 9c9425a9c99..00000000000 --- a/src/main/java/tectech/loader/TecTechConfig.java +++ /dev/null @@ -1,257 +0,0 @@ -package tectech.loader; - -import java.io.File; - -import eu.usrv.yamcore.config.ConfigManager; - -public class TecTechConfig extends ConfigManager { - - public TecTechConfig(File pConfigBaseDirectory, String pModCollectionDirectory, String pModID) { - super(pConfigBaseDirectory, pModCollectionDirectory, pModID); - } - - // final static to allow compiler to remove the debug code when this is false - public static boolean DEBUG_MODE = false; - public static boolean POWERLESS_MODE = false; - public boolean BOOM_ENABLE; - public boolean DISABLE_BLOCK_HARDNESS_NERF; - public boolean EASY_SCAN; - public boolean NERF_FUSION; - public boolean ENABLE_TURRET_EXPLOSIONS; - public float TURRET_DAMAGE_FACTOR; - public float TURRET_EXPLOSION_FACTOR; - - public boolean MOD_ADMIN_ERROR_LOGS; - - public boolean TESLA_MULTI_GAS_OUTPUT; - public float TESLA_MULTI_LOSS_FACTOR_OVERDRIVE; - public int TESLA_MULTI_LOSS_PER_BLOCK_T0; - public int TESLA_MULTI_LOSS_PER_BLOCK_T1; - public int TESLA_MULTI_LOSS_PER_BLOCK_T2; - public int TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM; - public int TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN; - public int TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON; - public int TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1; - public int TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2; - public int TESLA_MULTI_RANGE_COVER; - public int TESLA_MULTI_RANGE_TOWER; - public int TESLA_MULTI_RANGE_TRANSCEIVER; - public float TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE; - public int TESLA_SINGLE_LOSS_PER_BLOCK; - public int TESLA_SINGLE_RANGE; - public boolean TESLA_VISUAL_EFFECT; - - /** - * This loading phases do not correspond to mod loading phases! - */ - @Override - protected void PreInit() { - - BOOM_ENABLE = true; - DISABLE_BLOCK_HARDNESS_NERF = false; - EASY_SCAN = false; - NERF_FUSION = false; - ENABLE_TURRET_EXPLOSIONS = true; - TURRET_DAMAGE_FACTOR = 10; - TURRET_EXPLOSION_FACTOR = 1; - - MOD_ADMIN_ERROR_LOGS = false; - - TESLA_MULTI_GAS_OUTPUT = false; - TESLA_MULTI_LOSS_FACTOR_OVERDRIVE = 0.25F; - TESLA_MULTI_LOSS_PER_BLOCK_T0 = 1; - TESLA_MULTI_LOSS_PER_BLOCK_T1 = 1; - TESLA_MULTI_LOSS_PER_BLOCK_T2 = 1; - TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM = 100; - TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN = 50; - TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON = 50; - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1 = 2; - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2 = 4; - TESLA_MULTI_RANGE_COVER = 16; - TESLA_MULTI_RANGE_TOWER = 32; - TESLA_MULTI_RANGE_TRANSCEIVER = 16; - TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE = 0.25F; - TESLA_SINGLE_LOSS_PER_BLOCK = 1; - TESLA_SINGLE_RANGE = 20; - TESLA_VISUAL_EFFECT = true; - } - - /** - * This loading phases do not correspond to mod loading phases! - */ - @Override - protected void Init() { - DEBUG_MODE = _mainConfig - .getBoolean("DebugMode", "debug", DEBUG_MODE, "Enables logging and other purely debug features"); - POWERLESS_MODE = _mainConfig - .getBoolean("PowerlessMode", "debug", POWERLESS_MODE, "Enables 0EU/t multi block machinery"); - - BOOM_ENABLE = _mainConfig.getBoolean( - "BoomEnable", - "features", - BOOM_ENABLE, - "Set to false to disable explosions on everything bad that you can do"); - DISABLE_BLOCK_HARDNESS_NERF = _mainConfig.getBoolean( - "DisableBlockHardnessNerf", - "features", - DISABLE_BLOCK_HARDNESS_NERF, - "Set to true to disable the block hardness nerf"); - EASY_SCAN = _mainConfig.getBoolean( - "EasyScan", - "features", - EASY_SCAN, - "Enables tricorder to scan EM i/o hatches directly, too CHEEKY"); - NERF_FUSION = _mainConfig.getBoolean( - "NerfFusion", - "features", - NERF_FUSION, - "Set to true to enable removal of plasmas heavier than Fe and other weird ones"); - ENABLE_TURRET_EXPLOSIONS = _mainConfig.getBoolean( - "TurretBoomEnable", - "features", - ENABLE_TURRET_EXPLOSIONS, - "Set to false to disable explosions caused by EM turrets"); - TURRET_DAMAGE_FACTOR = _mainConfig.getFloat( - "TurretDamageFactor", - "features", - TURRET_DAMAGE_FACTOR, - 0, - Short.MAX_VALUE, - "Damage is multiplied by this number"); - TURRET_EXPLOSION_FACTOR = _mainConfig.getFloat( - "TurretExplosionFactor", - "features", - TURRET_EXPLOSION_FACTOR, - 0, - Short.MAX_VALUE, - "Explosion strength is multiplied by this number"); - - MOD_ADMIN_ERROR_LOGS = _mainConfig.getBoolean( - "AdminErrorLog", - "modules", - MOD_ADMIN_ERROR_LOGS, - "If set to true, every op/admin will receive all errors occurred during the startup phase as in game message on join"); - - TESLA_MULTI_GAS_OUTPUT = _mainConfig.getBoolean( - "TeslaMultiGasOutput", - "tesla_tweaks", - TESLA_MULTI_GAS_OUTPUT, - "Set to true to enable outputting plasmas as gasses from the tesla tower with a 1:1 ratio"); - TESLA_MULTI_LOSS_FACTOR_OVERDRIVE = _mainConfig.getFloat( - "TeslaMultiLossFactorOverdrive", - "tesla_tweaks", - TESLA_MULTI_LOSS_FACTOR_OVERDRIVE, - 0, - 1, - "Additional Tesla Tower power loss per amp as a factor of the tier voltage"); - TESLA_MULTI_LOSS_PER_BLOCK_T0 = _mainConfig.getInt( - "TeslaMultiLossPerBlockT0", - "tesla_tweaks", - TESLA_MULTI_LOSS_PER_BLOCK_T0, - 0, - Integer.MAX_VALUE, - "Tesla Tower power transmission loss per block per amp using no plasmas"); - TESLA_MULTI_LOSS_PER_BLOCK_T1 = _mainConfig.getInt( - "TeslaMultiLossPerBlockT1", - "tesla_tweaks", - TESLA_MULTI_LOSS_PER_BLOCK_T1, - 0, - Integer.MAX_VALUE, - "Tesla Tower power transmission loss per block per amp using helium or nitrogen plasma"); - TESLA_MULTI_LOSS_PER_BLOCK_T2 = _mainConfig.getInt( - "TeslaMultiLossPerBlockT2", - "tesla_tweaks", - TESLA_MULTI_LOSS_PER_BLOCK_T2, - 0, - Integer.MAX_VALUE, - "Tesla Tower power transmission loss per block per amp using radon plasma"); - TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM = _mainConfig.getInt( - "TeslaMultiPlasmaPerSecondT1Helium", - "tesla_tweaks", - TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM, - 0, - Integer.MAX_VALUE, - "Tesla Tower helium plasma consumed each second the tesla tower is active"); - TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN = _mainConfig.getInt( - "TeslaMultiPlasmaPerSecondT1Nitrogen", - "tesla_tweaks", - TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN, - 0, - Integer.MAX_VALUE, - "Tesla Tower nitrogen plasma consumed each second the tesla tower is active"); - TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON = _mainConfig.getInt( - "TeslaMultiPlasmaPerSecondT2Radon", - "tesla_tweaks", - TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON, - 0, - Integer.MAX_VALUE, - "Tesla Tower radon plasma consumed each second the tesla tower is active"); - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1 = _mainConfig.getInt( - "TeslaMultiRangeCoefficientPlasmaT1", - "tesla_tweaks", - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1, - 0, - Integer.MAX_VALUE, - "Tesla Tower T1 Plasmas Range Multiplier"); - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2 = _mainConfig.getInt( - "TeslaMultiRangeCoefficientPlasmaT2", - "tesla_tweaks", - TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2, - 0, - Integer.MAX_VALUE, - "Tesla Tower T2 Plasmas Range Multiplier"); - TESLA_MULTI_RANGE_COVER = _mainConfig.getInt( - "TeslaMultiRangeCover", - "tesla_tweaks", - TESLA_MULTI_RANGE_COVER, - 0, - Integer.MAX_VALUE, - "Tesla Tower to Tesla Coil Rich Edition Cover max range"); - TESLA_MULTI_RANGE_TOWER = _mainConfig.getInt( - "TeslaMultiRangeTower", - "tesla_tweaks", - TESLA_MULTI_RANGE_TOWER, - 0, - Integer.MAX_VALUE, - "Tesla Tower to Tower max range"); - TESLA_MULTI_RANGE_TRANSCEIVER = _mainConfig.getInt( - "TeslaMultiRangeTransceiver", - "tesla_tweaks", - TESLA_MULTI_RANGE_TRANSCEIVER, - 0, - Integer.MAX_VALUE, - "Tesla Tower to Transceiver max range"); - TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE = _mainConfig.getFloat( - "TeslaSingleLossFactorOverdrive", - "tesla_tweaks", - TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE, - 0, - 1, - "Additional Tesla Transceiver power loss per amp as a factor of the tier voltage"); - TESLA_SINGLE_LOSS_PER_BLOCK = _mainConfig.getInt( - "TeslaSingleLossPerBlock", - "tesla_tweaks", - TESLA_SINGLE_LOSS_PER_BLOCK, - 0, - Integer.MAX_VALUE, - "Tesla Transceiver power transmission loss per block per amp"); - TESLA_SINGLE_RANGE = _mainConfig.getInt( - "TeslaSingleRange", - "tesla_tweaks", - TESLA_SINGLE_RANGE, - 0, - Integer.MAX_VALUE, - "Tesla Transceiver to max range"); - TESLA_VISUAL_EFFECT = _mainConfig.getBoolean( - "EnableTeslaVisualEffect", - "tesla_tweaks", - TESLA_VISUAL_EFFECT, - "Set true to enable the cool visual effect when tesla tower running."); - } - - /** - * This loading phases do not correspond to mod loading phases! - */ - @Override - protected void PostInit() {} -} diff --git a/src/main/java/tectech/loader/gui/TecTechGUIClientConfig.java b/src/main/java/tectech/loader/gui/TecTechGUIClientConfig.java new file mode 100644 index 00000000000..0399c13a59d --- /dev/null +++ b/src/main/java/tectech/loader/gui/TecTechGUIClientConfig.java @@ -0,0 +1,17 @@ +package tectech.loader.gui; + +import static gregtech.api.enums.Mods.TecTech; + +import net.minecraft.client.gui.GuiScreen; + +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig; + +import tectech.loader.ConfigHandler; + +public class TecTechGUIClientConfig extends SimpleGuiConfig { + + public TecTechGUIClientConfig(GuiScreen parentScreen) throws ConfigException { + super(parentScreen, TecTech.ID, "TecTech - Tec Technology!", false, ConfigHandler.class); + } +} diff --git a/src/main/java/tectech/loader/gui/TecTechGUIFactory.java b/src/main/java/tectech/loader/gui/TecTechGUIFactory.java new file mode 100644 index 00000000000..f618e77a8cf --- /dev/null +++ b/src/main/java/tectech/loader/gui/TecTechGUIFactory.java @@ -0,0 +1,13 @@ +package tectech.loader.gui; + +import net.minecraft.client.gui.GuiScreen; + +import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory; + +public class TecTechGUIFactory implements SimpleGuiFactory { + + @Override + public Class mainConfigGuiClass() { + return TecTechGUIClientConfig.class; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java index d3cfb21c29d..e226162312d 100644 --- a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java @@ -29,7 +29,7 @@ import gregtech.api.objects.GTRenderedTexture; import tectech.Reference; import tectech.TecTech; -import tectech.loader.TecTechConfig; +import tectech.loader.ConfigHandler; import tectech.util.CommonValues; import tectech.util.TTUtility; @@ -220,7 +220,7 @@ public static class CapacitorComponent implements Comparable { this.maxHeat = maxHeat; this.subZero = subZero; componentBinds.put(unlocalizedName, this); - if (TecTechConfig.DEBUG_MODE) { + if (ConfigHandler.debug.DEBUG_MODE) { TecTech.LOGGER.info("Component registered: " + unlocalizedName); } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java index b52069fe967..cdc4b07a56f 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java @@ -32,7 +32,7 @@ import ic2.api.item.IElectricItem; import tectech.Reference; import tectech.TecTech; -import tectech.loader.TecTechConfig; +import tectech.loader.ConfigHandler; import tectech.thing.casing.BlockGTCasingsTT; import tectech.thing.casing.TTCasingsContainer; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; @@ -120,7 +120,7 @@ private long doChargeItemStack(IElectricItem item, ItemStack stack) { } return remove; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) { + if (ConfigHandler.debug.DEBUG_MODE) { e.printStackTrace(); } } @@ -139,7 +139,7 @@ private long doChargeItemStackRF(IEnergyContainerItem item, ItemStack stack) { } return RF; } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) { + if (ConfigHandler.debug.DEBUG_MODE) { e.printStackTrace(); } } diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java index d55bf32e902..4ced494b053 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java @@ -100,7 +100,7 @@ import gregtech.common.tileentities.machines.MTEHatchInputME; import gregtech.common.tileentities.machines.MTEHatchOutputBusME; import tectech.TecTech; -import tectech.loader.TecTechConfig; +import tectech.loader.ConfigHandler; import tectech.thing.block.BlockGodforgeGlass; import tectech.thing.block.TileEntityForgeOfGods; import tectech.thing.gui.TecTechUITextures; @@ -183,8 +183,6 @@ public class MTEForgeOfGods extends TTMultiblockBase implements IConstructable, private static final ItemStack STELLAR_FUEL = Avaritia.isModLoaded() ? getModItem(Avaritia.ID, "Resource", 1, 8) : GTOreDictUnificator.get(OrePrefixes.block, Materials.CosmicNeutronium, 1); - private final boolean debugMode = TecTechConfig.DEBUG_MODE; - public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { int realBudget = elementBudget >= 1000 ? elementBudget : Math.min(1000, elementBudget * 5); // 1000 blocks max per placement. @@ -489,7 +487,7 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { determineCompositionMilestoneLevel(); checkInversionStatus(); determineMilestoneProgress(); - if (!debugMode) { + if (!ConfigHandler.debug.DEBUG_MODE) { determineGravitonShardAmount(); } if (upgrades[30] && gravitonShardEjection) { @@ -703,7 +701,7 @@ private void buildThirdRing() { @Override public final void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (!debugMode) return; + if (!ConfigHandler.debug.DEBUG_MODE) return; if (isRenderActive) { destroyRenderer(); isRenderActive = false; @@ -1880,7 +1878,7 @@ protected ModularWindow createUpgradeTreeWindow(final EntityPlayer player) { } }) .setPos(282, 4)); - if (debugMode) { + if (ConfigHandler.debug.DEBUG_MODE) { builder.widget(new MultiChildWidget().addChild(new ButtonWidget().setOnClick((clickData, widget) -> { upgrades = new boolean[31]; materialPaidUpgrades = new boolean[7]; diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/MTETeslaTower.java b/src/main/java/tectech/thing/metaTileEntity/multi/MTETeslaTower.java index fc160411e43..b47a755203d 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/MTETeslaTower.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/MTETeslaTower.java @@ -61,7 +61,7 @@ import gregtech.api.util.IGTHatchAdder; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.shutdown.ShutDownReason; -import tectech.TecTech; +import tectech.loader.ConfigHandler; import tectech.loader.NetworkDispatcher; import tectech.mechanics.spark.RendererMessage; import tectech.mechanics.spark.ThaumSpark; @@ -90,32 +90,6 @@ public class MTETeslaTower extends TTMultiblockBase implements ISurvivalConstruc private final HashSet sparkList = new HashSet<>(); private int sparkCount = 10; - // region variables - private static final int transferRadiusTowerFromConfig = TecTech.configTecTech.TESLA_MULTI_RANGE_TOWER; // Default - // is 32 - private static final int transferRadiusTransceiverFromConfig = TecTech.configTecTech.TESLA_MULTI_RANGE_TRANSCEIVER; // Default - // is - // 16 - private static final int transferRadiusCoverUltimateFromConfig = TecTech.configTecTech.TESLA_MULTI_RANGE_COVER; // Default - // is - // 16 - private static final int plasmaRangeMultiT1 = TecTech.configTecTech.TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1; // Default - // is 2 - private static final int plasmaRangeMultiT2 = TecTech.configTecTech.TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2; // Default - // is 4 - private static final int heliumUse = TecTech.configTecTech.TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM; // Default is - // 100 - private static final int nitrogenUse = TecTech.configTecTech.TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN; // Default - // is 50 - private static final int radonUse = TecTech.configTecTech.TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON; // Default is 50 - private static final boolean visualEffect = TecTech.configTecTech.TESLA_VISUAL_EFFECT; // Default is true - // Default is {1, 1, 1} - private static final int[] plasmaTierLoss = new int[] { TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T0, - TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T1, TecTech.configTecTech.TESLA_MULTI_LOSS_PER_BLOCK_T2 }; - private static final float overDriveLoss = TecTech.configTecTech.TESLA_MULTI_LOSS_FACTOR_OVERDRIVE; // Default is - // 0.25F; - private static final boolean doFluidOutput = TecTech.configTecTech.TESLA_MULTI_GAS_OUTPUT; // Default is false - // Face icons private static Textures.BlockIcons.CustomIcon ScreenOFF; private static Textures.BlockIcons.CustomIcon ScreenON; @@ -295,8 +269,8 @@ public class MTETeslaTower extends TTMultiblockBase implements ISurvivalConstruc if (Double.isNaN(value)) return LedStatus.STATUS_WRONG; value = (int) value; if (value < 0) return LedStatus.STATUS_TOO_LOW; - if (value > transferRadiusTowerFromConfig) return LedStatus.STATUS_HIGH; - if (value < transferRadiusTowerFromConfig) return LedStatus.STATUS_LOW; + if (value > ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TOWER) return LedStatus.STATUS_HIGH; + if (value < ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TOWER) return LedStatus.STATUS_LOW; return LedStatus.STATUS_OK; }; private static final IStatusFunction TRANSFER_RADIUS_TRANSCEIVER_STATUS = (base, p) -> { @@ -304,8 +278,8 @@ public class MTETeslaTower extends TTMultiblockBase implements ISurvivalConstruc if (Double.isNaN(value)) return LedStatus.STATUS_WRONG; value = (int) value; if (value < 0) return LedStatus.STATUS_TOO_LOW; - if (value > transferRadiusTransceiverFromConfig) return LedStatus.STATUS_HIGH; - if (value < transferRadiusTransceiverFromConfig) return LedStatus.STATUS_LOW; + if (value > ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TRANSCEIVER) return LedStatus.STATUS_HIGH; + if (value < ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TRANSCEIVER) return LedStatus.STATUS_LOW; return LedStatus.STATUS_OK; }; private static final IStatusFunction TRANSFER_RADIUS_COVER_ULTIMATE_STATUS = (base, p) -> { @@ -313,8 +287,8 @@ public class MTETeslaTower extends TTMultiblockBase implements ISurvivalConstruc if (Double.isNaN(value)) return LedStatus.STATUS_WRONG; value = (int) value; if (value < 0) return LedStatus.STATUS_TOO_LOW; - if (value > transferRadiusCoverUltimateFromConfig) return LedStatus.STATUS_HIGH; - if (value < transferRadiusCoverUltimateFromConfig) return LedStatus.STATUS_LOW; + if (value > ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_COVER) return LedStatus.STATUS_HIGH; + if (value < ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_COVER) return LedStatus.STATUS_LOW; return LedStatus.STATUS_OK; }; private static final IStatusFunction OUTPUT_VOLTAGE_OR_CURRENT_STATUS = (base, p) -> { @@ -394,10 +368,10 @@ private float getRangeMulti(int mTier, int vTier) { int plasmaBoost; switch (plasmaTier) { case 2: - plasmaBoost = plasmaRangeMultiT2; + plasmaBoost = ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T2; break; case 1: - plasmaBoost = plasmaRangeMultiT1; + plasmaBoost = ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_COEFFICIENT_PLASMA_T1; break; default: plasmaBoost = 1; @@ -421,27 +395,24 @@ private void checkPlasmaBoost() { for (MTEHatchInput fluidHatch : mInputHatches) { if (fluidHatch.mFluid != null) { if (fluidHatch.mFluid.isFluidEqual(Materials.Helium.getPlasma(1)) - && fluidHatch.mFluid.amount >= heliumUse) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - heliumUse; - if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[] { Materials.Helium.getGas(heliumUse) }; - } + && fluidHatch.mFluid.amount >= ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount + - ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T1_HELIUM; + plasmaTier = 1; return; - } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) - && fluidHatch.mFluid.amount >= nitrogenUse) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - nitrogenUse; - if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[] { Materials.Nitrogen.getGas(nitrogenUse) }; - } + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Nitrogen.getPlasma(1)) && fluidHatch.mFluid.amount + >= ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount + - ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T1_NITROGEN; + plasmaTier = 1; return; - } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) - && fluidHatch.mFluid.amount >= radonUse) { - fluidHatch.mFluid.amount = fluidHatch.mFluid.amount - radonUse; - if (doFluidOutput) { - mOutputFluidsQueue = new FluidStack[] { Materials.Radon.getGas(radonUse) }; - } + } else if (fluidHatch.mFluid.isFluidEqual(Materials.Radon.getPlasma(1)) && fluidHatch.mFluid.amount + >= ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON) { + fluidHatch.mFluid.amount = fluidHatch.mFluid.amount + - ConfigHandler.TeslaTweaks.TESLA_MULTI_PLASMA_PER_SECOND_T2_RADON; + plasmaTier = 2; return; } @@ -653,18 +624,18 @@ protected void parametersInstantiation_EM() { popogaSetting = hatch_1.makeInParameter(1, 0, POPOGA_NAME, POPOGA_STATUS); transferRadiusTowerSetting = hatch_2.makeInParameter( 0, - transferRadiusTowerFromConfig, + ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TOWER, TRANSFER_RADIUS_TOWER_SETTING_NAME, TRANSFER_RADIUS_TOWER_STATUS); popogaSetting = hatch_2.makeInParameter(1, 0, POPOGA_NAME, POPOGA_STATUS); transferRadiusTransceiverSetting = hatch_3.makeInParameter( 0, - transferRadiusTransceiverFromConfig, + ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_TRANSCEIVER, TRANSFER_RADIUS_TRANSCEIVER_SETTING_NAME, TRANSFER_RADIUS_TRANSCEIVER_STATUS); transferRadiusCoverUltimateSetting = hatch_3.makeInParameter( 1, - transferRadiusCoverUltimateFromConfig, + ConfigHandler.TeslaTweaks.TESLA_MULTI_RANGE_COVER, TRANSFER_RADIUS_COVER_ULTIMATE_SETTING_NAME, TRANSFER_RADIUS_COVER_ULTIMATE_STATUS); outputVoltageSetting = hatch_4 @@ -775,7 +746,7 @@ public boolean onRunningTick(ItemStack aStack) { outputMaxDisplay.set(Math.max(outputCurrentDisplay.get(), outputMaxDisplay.get())); // TODO Encapsulate the spark sender sparkCount--; - if (sparkCount == 0 && visualEffect) { + if (sparkCount == 0 && ConfigHandler.teslaTweaks.TESLA_VISUAL_EFFECT) { IGregTechTileEntity mte = getBaseMetaTileEntity(); sparkCount = 10; if (!sparkList.isEmpty()) { @@ -910,12 +881,18 @@ public boolean isOverdriveEnabled() { @Override public int getTeslaEnergyLossPerBlock() { - return plasmaTierLoss[plasmaTier]; + + return switch (plasmaTier) { + case 0 -> ConfigHandler.TeslaTweaks.TESLA_MULTI_LOSS_PER_BLOCK_T0; + case 1 -> ConfigHandler.TeslaTweaks.TESLA_MULTI_LOSS_PER_BLOCK_T1; + case 2 -> ConfigHandler.TeslaTweaks.TESLA_MULTI_LOSS_PER_BLOCK_T2; + default -> throw new IllegalStateException(); + }; } @Override public float getTeslaOverdriveLossCoefficient() { - return overDriveLoss; + return ConfigHandler.TeslaTweaks.TESLA_MULTI_LOSS_FACTOR_OVERDRIVE; } @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java index 2a0c10f3038..fdc3f9f8260 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java @@ -33,7 +33,6 @@ import org.jetbrains.annotations.NotNull; import org.lwjgl.opengl.GL11; -import com.google.common.collect.Iterables; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.IAlignment; import com.gtnewhorizon.structurelib.alignment.IAlignmentProvider; @@ -69,7 +68,6 @@ import gregtech.api.interfaces.modularui.IBindPlayerInventoryUI; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.metatileentity.implementations.MTEHatchDynamo; @@ -89,11 +87,10 @@ import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gregtech.api.util.shutdown.SimpleShutDownReason; -import gregtech.common.Pollution; import gregtech.common.tileentities.machines.IDualInputHatch; import tectech.Reference; import tectech.TecTech; -import tectech.loader.TecTechConfig; +import tectech.loader.ConfigHandler; import tectech.thing.gui.TecTechUITextures; import tectech.thing.metaTileEntity.hatch.MTEHatchDataConnector; import tectech.thing.metaTileEntity.hatch.MTEHatchDataInput; @@ -566,7 +563,7 @@ public void onRemoval() { explodeMultiblock(); } } catch (Exception e) { - if (TecTechConfig.DEBUG_MODE) { + if (ConfigHandler.debug.DEBUG_MODE) { e.printStackTrace(); } } @@ -1490,9 +1487,6 @@ public boolean energyFlowOnRunningTick_EM(ItemStack aStack, boolean allowProduct if (allowProduction && euFlow > 0) { addEnergyOutput_EM(getPowerFlow() * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); } else if (euFlow < 0) { - if (TecTechConfig.POWERLESS_MODE) { - return true; - } if (!drainEnergyInput_EM( getPowerFlow(), getPowerFlow() * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), @@ -1509,9 +1503,6 @@ public boolean energyFlowOnRunningTick(ItemStack aStack, boolean allowProduction if (allowProduction && euFlow > 0) { addEnergyOutput_EM(getPowerFlow() * (long) mEfficiency / getMaxEfficiency(aStack), eAmpereFlow); } else if (euFlow < 0) { - if (TecTechConfig.POWERLESS_MODE) { - return true; - } if (!drainEnergyInput( getPowerFlow() * getMaxEfficiency(aStack) / Math.max(1000L, mEfficiency), eAmpereFlow)) { @@ -1625,7 +1616,7 @@ public boolean drainEnergyInput_EM(long EUtTierVoltage, long EUtEffective, long // - 1) / maxEUinputMin // + 1 = 1! //if // not too much A - if (TecTechConfig.DEBUG_MODE) { + if (ConfigHandler.debug.DEBUG_MODE) { TecTech.LOGGER.debug("L1 " + EUuse + ' ' + getEUVar() + ' ' + (EUuse > getEUVar())); TecTech.LOGGER.debug("L2 " + EUtEffective + ' ' + maxEUinputMax + ' ' + (EUtEffective > maxEUinputMax)); TecTech.LOGGER.debug("L3 " + Amperes + ' ' + getMaxInputEnergy()); @@ -1748,70 +1739,13 @@ public boolean explodesOnComponentBreak(ItemStack itemStack) { return false; } + // empty body to prevent any explosion @Override - public final void explodeMultiblock() { - if (explodedThisTick) { - return; - } - explodedThisTick = true; - if (!TecTech.configTecTech.BOOM_ENABLE) { - TecTech.proxy.broadcast( - "Multi Explode BOOM! " + getBaseMetaTileEntity().getXCoord() - + ' ' - + getBaseMetaTileEntity().getYCoord() - + ' ' - + getBaseMetaTileEntity().getZCoord()); - StackTraceElement[] ste = Thread.currentThread() - .getStackTrace(); - TecTech.proxy.broadcast("Multi Explode BOOM! " + ste[2].toString()); - return; - } - extraExplosions_EM(); - Pollution.addPollution(getBaseMetaTileEntity(), 600000); - mInventory[1] = null; - @SuppressWarnings("unchecked") - Iterable allHatches = Iterables.concat( - mInputBusses, - mOutputBusses, - mInputHatches, - mOutputHatches, - mDynamoHatches, - mMufflerHatches, - mEnergyHatches, - mMaintenanceHatches, - eParamHatches, - eEnergyMulti, - eUncertainHatches, - eDynamoMulti, - eInputData, - eOutputData); - for (MetaTileEntity tTileEntity : allHatches) { - if (tTileEntity != null && tTileEntity.getBaseMetaTileEntity() != null) { - tTileEntity.getBaseMetaTileEntity() - .doExplosion(V[9]); - } - } - getBaseMetaTileEntity().doExplosion(V[15]); - } + public final void explodeMultiblock() {} + // empty body to prevent any explosion @Override - public void doExplosion(long aExplosionPower) { - if (!TecTech.configTecTech.BOOM_ENABLE) { - TecTech.proxy.broadcast( - "Multi DoExplosion BOOM! " + getBaseMetaTileEntity().getXCoord() - + ' ' - + getBaseMetaTileEntity().getYCoord() - + ' ' - + getBaseMetaTileEntity().getZCoord()); - StackTraceElement[] ste = Thread.currentThread() - .getStackTrace(); - TecTech.proxy.broadcast("Multi DoExplosion BOOM! " + ste[2].toString()); - return; - } - explodeMultiblock(); - super.doExplosion(aExplosionPower); - } // Redirecting to explodemultiblock - // endregion + public void doExplosion(long aExplosionPower) {} // region adder methods @Override diff --git a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java index e0c2e8965cd..8a66736726b 100644 --- a/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java +++ b/src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java @@ -43,7 +43,7 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; -import tectech.loader.TecTechConfig; +import tectech.loader.ConfigHandler; import tectech.recipe.TecTechRecipeMaps; import tectech.util.CommonValues; @@ -51,7 +51,6 @@ public class MTEPlasmaModule extends MTEBaseModule { private long EUt = 0; private int currentParallel = 0; - private boolean debug = TecTechConfig.DEBUG_MODE; private int inputMaxParallel = 0; public MTEPlasmaModule(int aID, String aName, String aNameRegional) { @@ -126,7 +125,7 @@ protected void setProcessingLogicPower(ProcessingLogic logic) { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); - if (debug) { + if (ConfigHandler.debug.DEBUG_MODE) { builder.widget(createTestButton(builder)) .widget(createTestButton2()) .widget(createTestButton3()); diff --git a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java index b053cd656c8..c5db9320417 100644 --- a/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java +++ b/src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java @@ -27,7 +27,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTEBasicBatteryBuffer; -import tectech.TecTech; +import tectech.loader.ConfigHandler; import tectech.loader.NetworkDispatcher; import tectech.mechanics.spark.RendererMessage; import tectech.mechanics.spark.ThaumSpark; @@ -46,10 +46,7 @@ public class MTETeslaCoil extends MTEBasicBatteryBuffer implements ITeslaConnect private final HashSet sparkList = new HashSet<>(); private int sparkCount = 10; - private static final int transferRadiusMax = TecTech.configTecTech.TESLA_SINGLE_RANGE; // Default is 20 - private static final int perBlockLoss = TecTech.configTecTech.TESLA_SINGLE_LOSS_PER_BLOCK; // Default is 1 - private static final float overDriveLoss = TecTech.configTecTech.TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE; // Default is - // 0.25F + private static final int transferRadiusMax = ConfigHandler.TeslaTweaks.TESLA_SINGLE_RANGE; private static final int transferRadiusMin = 4; // Minimum user configurable private int transferRadius = transferRadiusMax; // Default transferRadius setting @@ -333,12 +330,12 @@ public boolean isOverdriveEnabled() { @Override public int getTeslaEnergyLossPerBlock() { - return perBlockLoss; + return ConfigHandler.TeslaTweaks.TESLA_SINGLE_LOSS_PER_BLOCK; } @Override public float getTeslaOverdriveLossCoefficient() { - return overDriveLoss; + return ConfigHandler.TeslaTweaks.TESLA_SINGLE_LOSS_FACTOR_OVERDRIVE; } @Override diff --git a/src/main/resources/assets/tectech/lang/en_US.lang b/src/main/resources/assets/tectech/lang/en_US.lang index b970024c971..768b8ccf81c 100644 --- a/src/main/resources/assets/tectech/lang/en_US.lang +++ b/src/main/resources/assets/tectech/lang/en_US.lang @@ -1774,3 +1774,7 @@ tt.IUPAC.Anti=Anti tt.keyword.Weird=* tt.chat.debug.generator=Laser mode: %s + +GT5U.gui.config.general.debug=Debug +GT5U.gui.config.general.features=Features +GT5U.gui.config.general.teslatweaks=Tesla Tweaks