From c74367258e8a2a60392234d2a1a13e0a19433795 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Thu, 19 Sep 2024 23:05:17 +0200 Subject: migrate GT++ config to GTNHLib (#3193) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz --- .../java/gregtech/api/enums/MetaTileEntityIDs.java | 31 + src/main/java/gregtech/asm/GTCorePlugin.java | 5 +- src/main/java/gtPlusPlus/GTplusplus.java | 20 +- src/main/java/gtPlusPlus/api/objects/Logger.java | 8 +- .../core/block/base/BlockBaseModular.java | 4 +- .../commands/CommandEnableDebugWhileRunning.java | 261 --- .../gtPlusPlus/core/common/compat/CompatIC2.java | 4 +- .../core/common/compat/CompatThaumcraft.java | 4 +- .../gtPlusPlus/core/config/ASMConfiguration.java | 49 + .../java/gtPlusPlus/core/config/ConfigHandler.java | 575 ----- .../java/gtPlusPlus/core/config/Configuration.java | 261 +++ .../java/gtPlusPlus/core/gui/config/ConfigGUI.java | 18 + .../gtPlusPlus/core/gui/config/GTPPGuiFactory.java | 13 + .../core/handler/AchievementHandler.java | 4 +- src/main/java/gtPlusPlus/core/item/ModItems.java | 103 +- .../core/item/base/BaseItemComponent.java | 13 +- .../core/item/base/cell/BaseItemCell.java | 8 +- .../core/item/base/dusts/BaseItemDustUnique.java | 3 +- .../core/item/base/ingots/BaseItemIngotHot.java | 10 +- .../core/item/base/ore/BaseOreComponent.java | 7 +- src/main/java/gtPlusPlus/core/lib/GTPPCore.java | 124 -- .../java/gtPlusPlus/core/proxy/ClientProxy.java | 4 +- .../gtPlusPlus/core/recipe/RecipesGeneral.java | 73 +- .../gtPlusPlus/core/recipe/RecipesMachines.java | 2264 ++++++++++---------- .../java/gtPlusPlus/everglades/GTPPEverglades.java | 17 +- .../everglades/biome/BiomeEverglades.java | 6 +- .../everglades/dimension/DimensionEverglades.java | 4 +- .../gtPlusPlus/everglades/gen/gt/WorldGen_GT.java | 11 +- .../everglades/gen/gt/WorldGen_GT_Ore_Layer.java | 19 +- .../gtPlusPlus/preloader/PreloaderGTOreDict.java | 4 +- .../java/gtPlusPlus/preloader/asm/AsmConfig.java | 144 -- .../Preloader_Transformer_Handler.java | 10 +- .../java/gtPlusPlus/recipes/RecipeRemovals.java | 4 +- .../java/gtPlusPlus/xmod/gregtech/HandlerGT.java | 2 - .../implementations/base/GTPPMultiBlockBase.java | 4 +- .../generators/MTERocketFuelGeneratorBase.java | 17 +- .../common/blocks/textures/TexturesGtBlock.java | 4 +- .../tileentities/generators/MTEBoilerBase.java | 11 +- .../generators/MTEGeothermalGenerator.java | 5 +- .../generators/MTESemiFluidGenerator.java | 5 +- .../basic/MTEAtmosphericReconditioner.java | 9 +- .../machines/basic/MTEPollutionCreator.java | 3 +- .../machines/basic/MTEPollutionDetector.java | 3 +- .../machines/multi/misc/MTEAmazonPackager.java | 4 +- .../processing/MTEIndustrialAlloySmelter.java | 3 +- .../multi/processing/MTEIndustrialArcFurnace.java | 3 +- .../multi/processing/MTEIndustrialCentrifuge.java | 3 +- .../multi/processing/MTEIndustrialChisel.java | 3 +- .../multi/processing/MTEIndustrialCokeOven.java | 3 +- .../processing/MTEIndustrialCuttingMachine.java | 3 +- .../multi/processing/MTEIndustrialDehydrator.java | 3 +- .../multi/processing/MTEIndustrialExtruder.java | 3 +- .../multi/processing/MTEIndustrialFluidHeater.java | 3 +- .../multi/processing/MTEIndustrialForgeHammer.java | 3 +- .../multi/processing/MTEIndustrialMacerator.java | 3 +- .../multi/processing/MTEIndustrialMixer.java | 3 +- .../MTEIndustrialMolecularTransformer.java | 3 +- .../processing/MTEIndustrialMultiMachine.java | 7 +- .../multi/processing/MTEIndustrialPlatePress.java | 5 +- .../multi/processing/MTEIndustrialSifter.java | 3 +- .../processing/MTEIndustrialThermalCentrifuge.java | 3 +- .../processing/MTEIndustrialVacuumFreezer.java | 3 +- .../multi/processing/MTEIndustrialWashPlant.java | 5 +- .../multi/processing/MTEIndustrialWireMill.java | 3 +- .../machines/multi/processing/MTEIsaMill.java | 3 +- .../processing/MTENuclearSaltProcessingPlant.java | 3 +- .../multi/processing/MTEndustrialElectrolyzer.java | 3 +- .../advanced/MTEAdvDistillationTower.java | 5 +- .../multi/processing/advanced/MTEAdvEBF.java | 3 +- .../advanced/MTEAdvImplosionCompressor.java | 3 +- .../multi/production/MTEAlloyBlastSmelter.java | 3 +- .../machines/multi/production/MTEAutoCrafter.java | 3 +- .../machines/multi/production/MTECyclotron.java | 3 +- .../multi/production/MTEElementalDuplicator.java | 3 +- .../multi/production/MTEFrothFlotationCell.java | 3 +- .../multi/production/MTEIndustrialFishingPond.java | 3 +- .../multi/production/MTEIndustrialRockBreaker.java | 3 +- .../production/MTELargeSemifluidGenerator.java | 3 +- .../multi/production/MTEMassFabricator.java | 3 +- .../machines/multi/production/MTERefinery.java | 3 +- .../multi/production/MTEThermalBoiler.java | 3 +- .../machines/multi/production/MTETreeFarm.java | 3 +- .../multi/production/algae/MTEAlgaePondBase.java | 3 +- .../production/turbines/MTELargerTurbineBase.java | 3 +- ...chMetaTileEntity_PowerSubStationController.java | 4 +- .../registration/gregtech/Gregtech4Content.java | 12 +- .../registration/gregtech/GregtechConduits.java | 11 +- .../gregtech/GregtechCustomHatches.java | 224 +- .../registration/gregtech/GregtechDehydrator.java | 4 +- .../gregtech/GregtechEnergyBuffer.java | 9 - .../GregtechGeothermalThermalGenerator.java | 5 +- .../gregtech/GregtechIndustrialBlastSmelter.java | 5 +- .../gregtech/GregtechIndustrialCentrifuge.java | 5 +- .../gregtech/GregtechIndustrialCokeOven.java | 5 +- .../gregtech/GregtechIndustrialCuttingFactory.java | 6 +- .../gregtech/GregtechIndustrialElectrolyzer.java | 5 +- .../gregtech/GregtechIndustrialExtruder.java | 5 +- .../gregtech/GregtechIndustrialFuelRefinery.java | 5 +- .../gregtech/GregtechIndustrialMacerator.java | 5 +- .../gregtech/GregtechIndustrialMassFabricator.java | 7 +- .../gregtech/GregtechIndustrialMixer.java | 5 +- .../gregtech/GregtechIndustrialMultiMachine.java | 5 +- .../gregtech/GregtechIndustrialPlatePress.java | 5 +- .../gregtech/GregtechIndustrialSifter.java | 5 +- .../GregtechIndustrialThermalCentrifuge.java | 5 +- .../gregtech/GregtechIndustrialTreeFarm.java | 9 +- .../gregtech/GregtechIndustrialWashPlant.java | 5 +- .../gregtech/GregtechIndustrialWiremill.java | 5 +- .../registration/gregtech/GregtechLFTR.java | 4 +- .../GregtechNuclearSaltProcessingPlant.java | 16 +- .../gregtech/GregtechPollutionDevices.java | 152 +- .../gregtech/GregtechPowerSubStation.java | 5 +- .../gregtech/GregtechQuantumForceTransformer.java | 14 +- .../gregtech/GregtechRedstoneButtonPanel.java | 8 +- .../gregtech/GregtechRedstoneCircuitBlock.java | 8 +- .../gregtech/GregtechRedstoneLamp.java | 7 +- .../gregtech/GregtechRedstoneStrengthDisplay.java | 17 +- .../gregtech/GregtechRedstoneStrengthScale.java | 8 +- .../gregtech/GregtechRocketFuelGenerator.java | 6 +- .../gregtech/GregtechSimpleWasher.java | 179 +- .../gregtech/GregtechTieredFluidTanks.java | 5 +- .../gregtech/GregtechTreeFarmerTE.java | 6 +- .../registration/gregtech/GregtechWaterPump.java | 6 +- .../resources/assets/miscutils/lang/en_US.lang | 235 +- src/main/resources/mcmod.info | 4 +- 125 files changed, 2268 insertions(+), 3055 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java create mode 100644 src/main/java/gtPlusPlus/core/config/ASMConfiguration.java delete mode 100644 src/main/java/gtPlusPlus/core/config/ConfigHandler.java create mode 100644 src/main/java/gtPlusPlus/core/config/Configuration.java create mode 100644 src/main/java/gtPlusPlus/core/gui/config/ConfigGUI.java create mode 100644 src/main/java/gtPlusPlus/core/gui/config/GTPPGuiFactory.java delete mode 100644 src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java (limited to 'src/main') diff --git a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java index 721cb36457..f815f60cad 100644 --- a/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java +++ b/src/main/java/gregtech/api/enums/MetaTileEntityIDs.java @@ -1822,6 +1822,24 @@ public enum MetaTileEntityIDs { Hatch_Muffler_Adv_UV(30008), Hatch_Muffler_Adv_MAX(30009), Hatch_Turbine_Rotor(30010), + Hatch_SuperBus_Input_LV(30022), + Hatch_SuperBus_Input_MV(30023), + Hatch_SuperBus_Input_HV(30024), + Hatch_SuperBus_Input_EV(30025), + Hatch_SuperBus_Input_IV(30026), + Hatch_SuperBus_Input_LuV(30027), + Hatch_SuperBus_Input_ZPM(30028), + Hatch_SuperBus_Input_UV(30029), + Hatch_SuperBus_Input_UHV(30030), + Hatch_SuperBus_Output_LV(30032), + Hatch_SuperBus_Output_MV(30033), + Hatch_SuperBus_Output_HV(30034), + Hatch_SuperBus_Output_EV(30035), + Hatch_SuperBus_Output_IV(30036), + Hatch_SuperBus_Output_LuV(30037), + Hatch_SuperBus_Output_ZPM(30038), + Hatch_SuperBus_Output_UV(30039), + Hatch_SuperBus_Output_UHV(30040), PipeIncoloy903(30995), Infinite_Item_Chest(31010), SimpleDustWasher_MV(31017), @@ -1884,10 +1902,23 @@ public enum MetaTileEntityIDs { GT4_Crop_Harvester_UV(31118), Mega_AlloyBlastSmelter(31150), QuantumForceTransformer(31151), + GT_MetaTileEntity_ChiselBus_LV(31778), + GT_MetaTileEntity_ChiselBus_MV(31779), + GT_MetaTileEntity_ChiselBus_HV(31780), + GT_MetaTileEntity_Solidifier_I(31781), + GT_MetaTileEntity_Solidifier_II(31782), + GT_MetaTileEntity_Solidifier_III(31783), + GT_MetaTileEntity_Solidifier_IV(31784), SimpleDustWasher_LV(31790), SimpleDustWasher_HV(31791), SimpleDustWasher_IV(31792), SimpleDustWasher_ZPM(31793), + RedstoneButtonPanel(31800), + RedstoneCircuitBlock(31801), + RedstoneLamp(31803), + RedstoneStrengthDisplay(31804), + RedstoneStrengthScale(31805), + WaterPump(31085), UniversalChemicalFuelEngine(32001), LargeEssentiaGenerator(32002), NeutronAcceleratorULV(32003), diff --git a/src/main/java/gregtech/asm/GTCorePlugin.java b/src/main/java/gregtech/asm/GTCorePlugin.java index 38d7548836..30bc193701 100644 --- a/src/main/java/gregtech/asm/GTCorePlugin.java +++ b/src/main/java/gregtech/asm/GTCorePlugin.java @@ -13,8 +13,8 @@ import bartworks.common.configs.Configuration; import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import gregtech.mixin.Mixin; +import gtPlusPlus.core.config.ASMConfiguration; import gtPlusPlus.preloader.PreloaderCore; -import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.preloader.asm.PreloaderDummyContainer; import gtPlusPlus.preloader.asm.transformers.Preloader_Transformer_Handler; @@ -27,6 +27,7 @@ public class GTCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader { static { try { ConfigurationManager.registerConfig(Configuration.class); + ConfigurationManager.registerConfig(ASMConfiguration.class); } catch (ConfigException e) { throw new RuntimeException(e); } @@ -64,7 +65,7 @@ public class GTCorePlugin implements IFMLLoadingPlugin, IEarlyMixinLoader { if (mcDir != null && mcDir.exists()) { PreloaderCore.setMinecraftDirectory(mcDir); } - PreloaderCore.DEBUG_MODE = AsmConfig.debugMode; + PreloaderCore.DEBUG_MODE = ASMConfiguration.debug.debugMode; } @Override diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index 8f36836521..16d0b013b4 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -12,6 +12,9 @@ import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.launchwrapper.Launch; +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.ConfigurationManager; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; @@ -33,9 +36,8 @@ import gregtech.api.util.FishPondFakeRecipe; import gregtech.api.util.SemiFluidFuelHandler; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.recipe.GTPPRecipeMaps; -import gtPlusPlus.core.commands.CommandEnableDebugWhileRunning; import gtPlusPlus.core.common.CommonProxy; -import gtPlusPlus.core.config.ConfigHandler; +import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.handler.BookHandler; import gtPlusPlus.core.handler.PacketHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; @@ -54,6 +56,7 @@ import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects; modid = Names.G_T_PLUS_PLUS, name = GTPPCore.name, version = GTPPCore.VERSION, + guiFactory = "gtPlusPlus.core.gui.config.GTPPGuiFactory", dependencies = "required-after:Forge;" + " after:TConstruct;" + " after:dreamcraft;" + " after:IC2;" @@ -106,6 +109,13 @@ public class GTplusplus implements ActionListener { } } + static { + try { + ConfigurationManager.registerConfig(Configuration.class); + } catch (ConfigException e) { + throw new RuntimeException(e); + } + } public static INIT_PHASE CURRENT_LOAD_PHASE = INIT_PHASE.SUPER; @Mod.Instance(Names.G_T_PLUS_PLUS) @@ -146,9 +156,6 @@ public class GTplusplus implements ActionListener { // Give this a go mate. setupMaterialBlacklist(); - // Handle GT++ Config - ConfigHandler.handleConfigFile(event); - // Check for Dev GTPPCore.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); @@ -166,7 +173,7 @@ public class GTplusplus implements ActionListener { MetaGTProxy.init(); CoreManager.init(); // Used by foreign players to generate .lang files for translation. - if (GTPPCore.ConfigSwitches.dumpItemAndBlockData) { + if (Configuration.debug.dumpItemAndBlockData) { LocaleUtils.generateFakeLocaleFile(); } } @@ -208,7 +215,6 @@ public class GTplusplus implements ActionListener { @EventHandler public synchronized void serverStarting(final FMLServerStartingEvent event) { INIT_PHASE.SERVER_START.setPhaseActive(true); - event.registerServerCommand(new CommandEnableDebugWhileRunning()); if (Thaumcraft.isModLoaded()) { event.registerServerCommand(new CommandDumpAspects()); } diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java index 8b5efa1536..c97c787cd3 100644 --- a/src/main/java/gtPlusPlus/api/objects/Logger.java +++ b/src/main/java/gtPlusPlus/api/objects/Logger.java @@ -4,9 +4,9 @@ import org.apache.logging.log4j.LogManager; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.relauncher.FMLRelaunchLog; -import gtPlusPlus.core.lib.GTPPCore; +import gtPlusPlus.core.config.ASMConfiguration; +import gtPlusPlus.core.config.Configuration; import gtPlusPlus.preloader.PreloaderCore; -import gtPlusPlus.preloader.asm.AsmConfig; public class Logger { @@ -21,7 +21,7 @@ public class Logger { return gtPlusPlusLogger; } - private static final boolean enabled = !AsmConfig.disableAllLogging; + private static final boolean enabled = !ASMConfiguration.debug.disableAllLogging; public static final org.apache.logging.log4j.Logger getLogger() { return modLogger; @@ -38,7 +38,7 @@ public class Logger { public static void MACHINE_INFO(String s, Object... args) { if (enabled) { boolean localPlayer = PreloaderCore.DEV_ENVIRONMENT; - if (GTPPCore.ConfigSwitches.MACHINE_INFO || localPlayer) { + if (Configuration.debug.MachineInfo || localPlayer) { final String name1 = gtPlusPlus.core.util.reflect.ReflectionUtils.getMethodName(2); modLogger.info("Machine Info: " + s + " | " + name1, args); } diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java index abd83d7171..b70e96108c 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -19,8 +19,8 @@ import gregtech.api.enums.TextureSet; import gregtech.api.util.GTLanguageManager; import gregtech.api.util.GTOreDictUnificator; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock; -import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; @@ -198,7 +198,7 @@ public class BlockBaseModular extends BasicBlock { @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(final IIconRegister iIcon) { - if (!GTPPCore.ConfigSwitches.useGregtechTextures || this.blockMaterial == null + if (!Configuration.visual.useGregtechTextures || this.blockMaterial == null || this.thisBlock == BlockTypes.ORE) { this.blockIcon = iIcon.registerIcon(GTPlusPlus.ID + ":" + this.thisBlock.getTexture()); } diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java deleted file mode 100644 index 0001f825d8..0000000000 --- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ /dev/null @@ -1,261 +0,0 @@ -package gtPlusPlus.core.commands; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import net.minecraft.command.ICommand; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; - -import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.NBTUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.preloader.PreloaderCore; -import gtPlusPlus.preloader.asm.AsmConfig; - -public class CommandEnableDebugWhileRunning implements ICommand { - - private final List aliases; - - public CommandEnableDebugWhileRunning() { - this.aliases = new ArrayList<>(); - this.aliases.add("gtplusplus"); - } - - @Override - public int compareTo(final Object o) { - if (o instanceof ICommand c) { - return this.getCommandName() - .compareTo(c.getCommandName()); - } - return -1; - } - - @Override - public String getCommandName() { - return "gtpp"; - } - - // Use '/gtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging. - // Using nothing after the command toggles both to their opposite states respectively. - @Override - public String getCommandUsage(final ICommandSender var1) { - return "/gtpp ?"; - } - - @Override - public List getCommandAliases() { - return this.aliases; - } - - @Override - public void processCommand(final ICommandSender S, final String[] argString) { - int aMaxArgumentsAllowed = 2; - - if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed) - || argString[0].equalsIgnoreCase("?")) { - Logger.INFO("Listing commands and their uses."); - final EntityPlayer P = CommandUtils.getPlayer(S); - AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging; - PlayerUtils.messagePlayer(P, "The following are valid args for the '/gtpp' command:"); - PlayerUtils.messagePlayer(P, "? - This help command."); - PlayerUtils.messagePlayer(P, "logging - Toggles ALL GT++ logging for current session."); - PlayerUtils.messagePlayer(P, "hand - Lists information about held item."); - PlayerUtils.messagePlayer(P, "fuid xxx - Tries to find the fluid in the FluidRegistry."); - PlayerUtils.messagePlayer( - P, - "debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)"); - } else if (argString[0].equalsIgnoreCase("debug")) { - Logger.INFO("Toggling Debug Mode."); - final EntityPlayer P = CommandUtils.getPlayer(S); - if (PlayerUtils.isPlayerOP(P)) { - PreloaderCore.DEBUG_MODE = !PreloaderCore.DEBUG_MODE; - PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + PreloaderCore.DEBUG_MODE); - } - } else if (argString[0].equalsIgnoreCase("logging")) { - Logger.INFO("Toggling Logging."); - final EntityPlayer P = CommandUtils.getPlayer(S); - AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging; - PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging)); - } - /* - * else if (argString[0].toLowerCase().equals("test")) { ItemStack mSemiFluidgen = - * ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1); final EntityPlayer P = CommandUtils.getPlayer(S); - * if(mSemiFluidgen != null) { PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); } } - */ - - else if (argString[0].equalsIgnoreCase("inv")) { - final EntityPlayer P = CommandUtils.getPlayer(S); - if (P != null && !P.worldObj.isRemote) { - ItemStack[] aInv = P.inventory.mainInventory; - for (ItemStack aItem : aInv) { - if (aItem != null) { - String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; - String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; - Logger.INFO( - aModID + ":" - + aRegistryName - + ":" - + aItem.getItemDamage() - + " | " - + aItem.getDisplayName()); - } - } - PlayerUtils.messagePlayer(P, "Dumped Inventory."); - } - } else if (argString[0].equalsIgnoreCase("hand")) { - final EntityPlayer P = CommandUtils.getPlayer(S); - if (P != null) { - ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P); - if (aHeldItem != null) { - String aItemDisplayName = ItemUtils.getItemName(aHeldItem); - String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem); - String aNbtString = tryIterateNBTData(aHeldItem); - ArrayList aOreDictNames = new ArrayList<>(); - - int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem); - for (int id : aOreIDs) { - String aOreNameFromID = OreDictionary.getOreName(id); - if (aOreNameFromID != null && aOreNameFromID.length() > 0 - && !aOreNameFromID.equals("Unknown")) { - aOreDictNames.add(aOreNameFromID); - } - } - - String aOreDictData = ""; - if (!aOreDictNames.isEmpty()) { - for (String tag : aOreDictNames) { - aOreDictData += (tag + ", "); - } - if (aOreDictData.endsWith(", ")) { - aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2); - } - } - - ArrayList aFluidContainerData = new ArrayList<>(); - FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem); - if (aHeldItemFluid != null) { - aFluidContainerData.add("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName()); - aFluidContainerData.add("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName()); - aFluidContainerData.add( - "Fluid Unlocal Name: " + aHeldItemFluid.getFluid() - .getUnlocalizedName()); - aFluidContainerData.add("Fluid Local Name: " + aHeldItemFluid.getLocalizedName()); - aFluidContainerData.add( - "Fluid Name: " + aHeldItemFluid.getFluid() - .getName()); - } - - PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] "); - if (!aFluidContainerData.isEmpty()) { - for (String s : aFluidContainerData) { - PlayerUtils.messagePlayer(P, s); - } - } - if (!aOreDictNames.isEmpty()) { - PlayerUtils.messagePlayer(P, aOreDictData); - } - if (!aNbtString.isEmpty()) { - PlayerUtils.messagePlayer(P, aNbtString); - } - } else { - PlayerUtils.messagePlayer(P, "No item held."); - } - } - } else if (argString[0].equalsIgnoreCase("fluid")) { - if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) { - final EntityPlayer P = CommandUtils.getPlayer(S); - FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1); - if (P != null && aFluid != null) { - PlayerUtils.messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid)); - } else if (P != null) { - PlayerUtils.messagePlayer(P, "Could not find any fluids."); - } - } - } else if (argString[0].equalsIgnoreCase("item")) { - if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) { - final EntityPlayer P = CommandUtils.getPlayer(S); - ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1); - if (P != null && aTest != null) { - PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest)); - } else if (P != null) { - PlayerUtils.messagePlayer(P, "Could not find valid item."); - } - } - } else { - final EntityPlayer P = CommandUtils.getPlayer(S); - PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'"); - } - } - - @Override - public boolean canCommandSenderUseCommand(final ICommandSender var1) { - return var1 != null && CommandUtils.getPlayer(var1) != null; - } - - @Override - public List addTabCompletionOptions(final ICommandSender var1, final String[] var2) { - ArrayList aTabCompletes = new ArrayList<>(); - aTabCompletes.add("?"); - aTabCompletes.add("logging"); - aTabCompletes.add("debug"); - aTabCompletes.add("hand"); - aTabCompletes.add("fluid"); - return aTabCompletes; - } - - @Override - public boolean isUsernameIndex(final String[] var1, final int var2) { - // TODO Auto-generated method stub - return false; - } - - public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost) { - return true; - } - - public static String tryIterateNBTData(ItemStack aStack) { - try { - ArrayList aItemDataTags = new ArrayList<>(); - NBTTagCompound aNBT = NBTUtils.getNBT(aStack); - if (!aNBT.hasNoTags()) { - Map mInternalMap = ReflectionUtils.getField(aNBT, "tagMap"); - if (mInternalMap != null) { - for (Map.Entry e : mInternalMap.entrySet()) { - aItemDataTags.add( - e.getKey() - .toString() + ":" - + e.getValue()); - } - int a = 0; - StringBuilder data = new StringBuilder(); - for (String tag : aItemDataTags) { - data.append(tag) - .append(", "); - } - if (data.toString() - .endsWith(", ")) { - data = new StringBuilder(data.substring(0, data.length() - 2)); - } - return data.toString(); - } else { - Logger.INFO("Data map reflected from NBTTagCompound was not valid."); - return "Bad NBT"; - } - } - } catch (Throwable ignored) {} - return ""; - } -} diff --git a/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java b/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java index c6662800b2..7e60f95d37 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java +++ b/src/main/java/gtPlusPlus/core/common/compat/CompatIC2.java @@ -4,7 +4,7 @@ import static gtPlusPlus.core.handler.CompatHandler.RemoveRecipeQueue; import net.minecraft.item.ItemStack; -import gtPlusPlus.core.lib.GTPPCore.ConfigSwitches; +import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -42,7 +42,7 @@ public class CompatIC2 { private static void run() { - if (ConfigSwitches.disableIC2Recipes) { + if (Configuration.machines.disableIC2Recipes) { // Remove these. RemoveRecipeQueue.add("IC2:itemCable"); diff --git a/src/main/java/gtPlusPlus/core/common/compat/CompatThaumcraft.java b/src/main/java/gtPlusPlus/core/common/compat/CompatThaumcraft.java index 8e06c95c67..b23d02e789 100644 --- a/src/main/java/gtPlusPlus/core/common/compat/CompatThaumcraft.java +++ b/src/main/java/gtPlusPlus/core/common/compat/CompatThaumcraft.java @@ -3,14 +3,14 @@ package gtPlusPlus.core.common.compat; import static gregtech.api.enums.Mods.ForbiddenMagic; import gregtech.api.util.GTOreDictUnificator; -import gtPlusPlus.core.lib.GTPPCore.ConfigSwitches; +import gtPlusPlus.core.config.Configuration; import gtPlusPlus.core.util.minecraft.ItemUtils; public class CompatThaumcraft { public static void OreDict() { - if (ConfigSwitches.enableThaumcraftShardUnification) { + if (Configuration.machines.enableThaumcraftShardUnification) { run(); } } diff --git a/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java new file mode 100644 index 0000000000..d79a746642 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/config/ASMConfiguration.java @@ -0,0 +1,49 @@ +package gtPlusPlus.core.config; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.G_T_PLUS_PLUS, configSubDirectory = "GTPlusPlus", category = "asm", filename = "ASM") +@Config.LangKeyPattern(pattern = "gtpp.gui.config.%cat.%field", fullyQualified = true) +@Config.Comment("ASM section") +@Config.RequiresMcRestart +public class ASMConfiguration { + + public static Debug debug = new Debug(); + public static General general = new General(); + + // Debug + @Config.Comment("Debug section") + public static class Debug { + + @Config.Comment("Disables ALL logging from GT++.") + @Config.DefaultBoolean(true) + public boolean disableAllLogging; + + @Config.Comment("Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)") + @Config.DefaultBoolean(false) + public boolean debugMode; + + @Config.Comment("Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)") + @Config.DefaultBoolean(true) + public boolean enableCofhPatch; + + @Config.Comment("Enable/Disable Forge OreDictionary Patch (Useful for Development)") + @Config.DefaultBoolean(false) + public boolean enableOreDictPatch; + } + + @Config.Comment("General section") + public static class General { + // General Features + + @Config.Comment("Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544") + @Config.DefaultBoolean(true) + public boolean enabledLwjglKeybindingFix; + + @Config.Comment("Fixes small oversights in Thaumcraft 4.") + @Config.DefaultBoolean(true) + public boolean enableTcAspectSafety; + } +} diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java deleted file mode 100644 index e6041ab78a..0000000000 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ /dev/null @@ -1,575 +0,0 @@ -package gtPlusPlus.core.config; - -import static gregtech.api.enums.Mods.GregTech; -import static gtPlusPlus.core.lib.GTPPCore.ConfigSwitches.*; -import static gtPlusPlus.core.lib.GTPPCore.EVERGLADESBIOME_ID; -import static gtPlusPlus.core.lib.GTPPCore.EVERGLADES_ID; -import static gtPlusPlus.core.lib.GTPPCore.turbineCutoffBase; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; - -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public class ConfigHandler { - - public static void handleConfigFile(final FMLPreInitializationEvent event) { - final Configuration config = new Configuration( - new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); - config.load(); - - // Debug - /* - * DEBUG = config.getBoolean("debugMode", "debug", false, - * "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"); - */ - MACHINE_INFO = config.getBoolean( - "enableMachineInfoLogging", - "debug", - false, - "Makes many machines display lots of debug logging."); - showHiddenNEIItems = config - .getBoolean("showHiddenNEIItems", "debug", false, "Makes all items hidden from NEI display."); - dumpItemAndBlockData = config.getBoolean( - "dumpItemAndBlockData", - "debug", - false, - "Dumps all GT++ and Toxic Everglade Data to en_US.lang in the config folder. This config option can be used by foreign players to generate blank .lang files, which they can populate with their language of choice."); - - // Machines - enableThaumcraftShardUnification = config.getBoolean( - "enableThaumcraftShardUnification", - "machines", - false, - "Allows the use of TC shards across many recipes by oreDicting them into a common group."); - disableIC2Recipes = config.getBoolean( - "disableIC2Recipes", - "machines", - false, - "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); - boilerSteamPerSecond = config.getInt( - "boilerSteamPerSecond", - "machines", - 750, - 0, - 10000, - "Sets the steam per second value in LV,MV,HV boilers (respectively 1x,2x,3x this number for the tiers)"); - - // GT-Fixes - turbineCutoffBase = config.getInt( - "turbineCutoffBase", - GregTech.ID, - 75000, - 0, - Integer.MAX_VALUE, - "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable."); - - // Pipes & Cables - enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", GregTech.ID, true, "Adds Custom GT Fluid Pipes."); - enableCustom_Cables = config.getBoolean("enableCustom_Cables", GregTech.ID, true, "Adds Custom GT Cables."); - - enableMachine_Dehydrators = config - .getBoolean("enableMachineDehydrators", GregTech.ID, true, "These dehydrate stuff."); - enableMachine_SteamConverter = config - .getBoolean("enableMachineSteamConverter", GregTech.ID, true, "Converts IC2 steam -> Railcraft steam."); - enableMachine_FluidTanks = config - .getBoolean("enableMachineFluidTanks", GregTech.ID, true, "Portable fluid tanks."); - enableMachine_RocketEngines = config.getBoolean( - "enableMachineRocketEngines", - GregTech.ID, - true, - "Diesel egines with different internals, they consume less fuel overall."); - enableMachine_GeothermalEngines = config.getBoolean( - "enableMachineGeothermalEngines", - GregTech.ID, - true, - "These may be overpowered, Consult a local geologist."); - enableMachine_Tesseracts = config - .getBoolean("enableMachineTesseracts", GregTech.ID, true, "Tesseracts for wireless item/fluid movement."); - enableMachine_SimpleWasher = config.getBoolean( - "enableMachineSimpleWasher", - GregTech.ID, - true, - "Very basic automated cauldron for dust washing."); - enableMachine_Pollution = config - .getBoolean("enableMachinePollution", GregTech.ID, true, "Pollution Detector & Scrubbers."); - - // Multi machines - enableMultiblock_AlloyBlastSmelter = config.getBoolean( - "enableMultiblockAlloyBlastSmelter", - GregTech.ID, - true, - "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); - enableMultiblock_IndustrialCentrifuge = config - .getBoolean("enableMultiblockIndustrialCentrifuge", GregTech.ID, true, "Spin, Spin, Spiiiin."); - enableMultiblock_IndustrialCokeOven = config.getBoolean( - "enableMultiblockIndustrialCokeOven", - GregTech.ID, - true, - "Pyro Oven Alternative, older, more realistic, better."); - enableMultiblock_IndustrialElectrolyzer = config.getBoolean( - "enableMultiblockIndustrialElectrolyzer", - GregTech.ID, - true, - "Electrolyzes things with extra bling factor."); - enableMultiblock_IndustrialMacerationStack = config.getBoolean( - "enableMultiblockIndustrialMacerationStack", - GregTech.ID, - true, - "A hyper efficient maceration tower, nets more bonus outputs."); - enableMultiblock_IndustrialPlatePress = config.getBoolean( - "enableMultiblockIndustrialPlatePress", - GregTech.ID, - true, - "Industrial bendering machine thingo."); - enableMultiblock_IndustrialWireMill = config.getBoolean( - "enableMultiblockIndustrialWireMill", - GregTech.ID, - true, - "Produces fine wire and exotic cables."); - enableMultiblock_MatterFabricator = config - .getBoolean("enableMultiblockMatterFabricator", GregTech.ID, true, "?FAB?RIC?ATE MA?TT?ER."); - enableMultiblock_MultiTank = config.getBoolean( - "enableMultiblockMultiTank", - GregTech.ID, - true, - "Tall tanks, each layer adds extra fluid storage."); - enableMultiblock_PowerSubstation = config - .getBoolean("enableMultiblockPowerSubstation", GregTech.ID, true, "For managing large power grids."); - enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean( - "enableMultiblockLiquidFluorideThoriumReactor", - GregTech.ID, - true, - "For supplying large power grids."); - enableMultiblock_NuclearFuelRefinery = config.getBoolean( - "enableMultiblock_NuclearFuelRefinery", - GregTech.ID, - true, - "Refines molten chemicals into nuclear fuels."); - enableMultiblock_NuclearSaltProcessingPlant = config.getBoolean( - "enableMultiblockNuclearSaltProcessingPlant", - GregTech.ID, - true, - "Reprocesses depleted nuclear salts into useful chemicals."); - enableMultiblock_IndustrialSifter = config - .getBoolean("enableMultiblock_IndustrialSifter", GregTech.ID, true, "Large scale sifting."); - enableMultiblock_LargeAutoCrafter = config.getBoolean( - "enableMultiblock_LargeAutoCrafter", - GregTech.ID, - true, - "Can Assemble, Disassemble and Craft Project data from Data Sticks."); - enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean( - "enableMultiblock_IndustrialThermalCentrifuge", - GregTech.ID, - true, - "Your warm spin for the ore thing."); - enableMultiblock_IndustrialWashPlant = config.getBoolean( - "enableMultiblock_IndustrialWashPlant", - GregTech.ID, - true, - "Used to wash the dirt, riiiiight offff.."); - enableMultiblock_ThermalBoiler = config.getBoolean( - "enableMachineThermalBoiler", - GregTech.ID, - true, - "Thermal Boiler from GT4. Can Filter Lava for resources."); - enableMultiblock_IndustrialCuttingMachine = config.getBoolean( - "enableMultiblock_IndustrialCuttingMachine", - GregTech.ID, - true, - "Very fast and efficient Cutting Machine."); - enableMultiblock_IndustrialFishingPort = config - .getBoolean("enableMultiblock_IndustrialFishingPort", GregTech.ID, true, "Fish the seas, except on land."); - enableMultiblock_IndustrialExtrudingMachine = config.getBoolean( - "enableMultiblock_IndustrialExtrudingMachine", - GregTech.ID, - true, - "Very fast and efficient Extruding Machine."); - enableMultiblock_IndustrialMultiMachine = config.getBoolean( - "enableMultiblock_IndustrialMultiMachine", - GregTech.ID, - true, - "Can run recipes for 9 different types of machines."); - enableMultiblock_Cyclotron = config - .getBoolean("enableMultiblock_Cyclotron", GregTech.ID, true, "COMET - Scientific Cyclotron."); - - // Features - enableWatchdogBGM = config.getInt( - "enableWatchdogBGM", - "features", - 0, - 0, - Short.MAX_VALUE, - "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); - hideUniversalCells = config - .getBoolean("hideUniversalCells", "features", true, "Hides every filled IC2 Universal Cell from NEI."); - - // Biomes - EVERGLADES_ID = config.getInt("darkworld_ID", "worldgen", 227, 1, 254, "The ID of the Dark Dimension."); - EVERGLADESBIOME_ID = config - .getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension."); - - // Pollution - pollutionPerSecondMultiPackager = config - .get( - "pollution", - "pollutionPerSecondMultiPackager", - pollutionPerSecondMultiPackager, - "pollution rate in gibbl/s for the Amazon warehousing depot") - .getInt(pollutionPerSecondMultiPackager); - pollutionPerSecondMultiIndustrialAlloySmelter = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialAlloySmelter", - pollutionPerSecondMultiIndustrialAlloySmelter, - "pollution rate in gibbl/s for the Alloy blast smelter") - .getInt(pollutionPerSecondMultiIndustrialAlloySmelter); - pollutionPerSecondMultiIndustrialArcFurnace = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialArcFurnace", - pollutionPerSecondMultiIndustrialArcFurnace, - "pollution rate in gibbl/s for the High current arc furnace") - .getInt(pollutionPerSecondMultiIndustrialArcFurnace); - pollutionPerSecondMultiIndustrialCentrifuge = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialCentrifuge", - pollutionPerSecondMultiIndustrialCentrifuge, - "pollution rate in gibbl/s for the Industrial centrifuge") - .getInt(pollutionPerSecondMultiIndustrialCentrifuge); - pollutionPerSecondMultiIndustrialCokeOven = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialCokeOven", - pollutionPerSecondMultiIndustrialCokeOven, - "pollution rate in gibbl/s for the Industrial coke oven") - .getInt(pollutionPerSecondMultiIndustrialCokeOven); - pollutionPerSecondMultiIndustrialCuttingMachine = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialCuttingMachine", - pollutionPerSecondMultiIndustrialCuttingMachine, - "pollution rate in gibbl/s for the Cutting factory") - .getInt(pollutionPerSecondMultiIndustrialCuttingMachine); - pollutionPerSecondMultiIndustrialDehydrator = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialDehydrator", - pollutionPerSecondMultiIndustrialDehydrator, - "pollution rate in gibbl/s for the Utupu-Tanuri") - .getInt(pollutionPerSecondMultiIndustrialDehydrator); - pollutionPerSecondMultiIndustrialElectrolyzer = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialElectrolyzer", - pollutionPerSecondMultiIndustrialElectrolyzer, - "pollution rate in gibbl/s for the Industrial electrolyzer") - .getInt(pollutionPerSecondMultiIndustrialElectrolyzer); - pollutionPerSecondMultiIndustrialExtruder = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialExtruder", - pollutionPerSecondMultiIndustrialExtruder, - "pollution rate in gibbl/s for the Industrial extrusion machine") - .getInt(pollutionPerSecondMultiIndustrialExtruder); - pollutionPerSecondMultiIndustrialMacerator = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialMacerator", - pollutionPerSecondMultiIndustrialMacerator, - "pollution rate in gibbl/s for the Maceration stack") - .getInt(pollutionPerSecondMultiIndustrialMacerator); - pollutionPerSecondMultiIndustrialMixer = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialMixer", - pollutionPerSecondMultiIndustrialMixer, - "pollution rate in gibbl/s for the Industrial mixing machine") - .getInt(pollutionPerSecondMultiIndustrialMixer); - pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal", - pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal, - "pollution rate in gibbl/s for the Large processing factory in metal mode") - .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal); - pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid", - pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid, - "pollution rate in gibbl/s for the Large processing factory in fluid mode") - .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid); - pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", - pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc, - "pollution rate in gibbl/s for the Large processing factory in misc mode") - .getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc); - pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", - pollutionPerSecondMultiIndustrialPlatePress_ModeForming, - "pollution rate in gibbl/s for the Industrial material press in forming mode") - .getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming); - pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", - pollutionPerSecondMultiIndustrialPlatePress_ModeBending, - "pollution rate in gibbl/s for the Industrial material press in bending mode") - .getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending); - pollutionPerSecondMultiIndustrialForgeHammer = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialForgeHammer", - pollutionPerSecondMultiIndustrialForgeHammer, - "pollution rate in gibbl/s for the Industrial Forge Hammer") - .getInt(pollutionPerSecondMultiIndustrialForgeHammer); - pollutionPerSecondMultiIndustrialSifter = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialSifter", - pollutionPerSecondMultiIndustrialSifter, - "pollution rate in gibbl/s for the Large Sifter") - .getInt(pollutionPerSecondMultiIndustrialSifter); - pollutionPerSecondMultiIndustrialThermalCentrifuge = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialThermalCentrifuge", - pollutionPerSecondMultiIndustrialThermalCentrifuge, - "pollution rate in gibbl/s for the Large thermal refinery") - .getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge); - pollutionPerSecondMultiIndustrialVacuumFreezer = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialVacuumFreezer", - pollutionPerSecondMultiIndustrialVacuumFreezer, - "pollution rate in gibbl/s for the Cryogenic freezer") - .getInt(pollutionPerSecondMultiIndustrialVacuumFreezer); - pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath", - pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath, - "pollution rate in gibbl/s for the Ore washing plant in chemical bath mode") - .getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath); - pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialWashPlant_ModeWasher", - pollutionPerSecondMultiIndustrialWashPlant_ModeWasher, - "pollution rate in gibbl/s for the Ore washing plant in ore washer mode") - .getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeWasher); - pollutionPerSecondMultiIndustrialWireMill = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialWireMill", - pollutionPerSecondMultiIndustrialWireMill, - "pollution rate in gibbl/s for the Wire factory") - .getInt(pollutionPerSecondMultiIndustrialWireMill); - pollutionPerSecondMultiIsaMill = config - .get( - "pollution", - "pollutionPerSecondMultiIsaMill", - pollutionPerSecondMultiIsaMill, - "pollution rate in gibbl/s for the IsaMill grinding machine") - .getInt(pollutionPerSecondMultiIsaMill); - pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = config - .get( - "pollution", - "pollutionPerSecondMultiAdvDistillationTower_ModeDistillery", - pollutionPerSecondMultiAdvDistillationTower_ModeDistillery, - "pollution rate in gibbl/s for the Dangote distillus in distillery mode") - .getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDistillery); - pollutionPerSecondMultiAdvDistillationTower_ModeDT = config - .get( - "pollution", - "pollutionPerSecondMultiAdvDistillationTower_ModeDT", - pollutionPerSecondMultiAdvDistillationTower_ModeDT, - "pollution rate in gibbl/s for the Dangote distillus in distillation tower mode") - .getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDT); - pollutionPerSecondMultiAdvEBF = config - .get( - "pollution", - "pollutionPerSecondMultiAdvEBF", - pollutionPerSecondMultiAdvEBF, - "pollution rate in gibbl/s for the Volcanus") - .getInt(pollutionPerSecondMultiAdvEBF); - pollutionPerSecondMultiAdvImplosion = config - .get( - "pollution", - "pollutionPerSecondMultiAdvImplosion", - pollutionPerSecondMultiAdvImplosion, - "pollution rate in gibbl/s for the Density^2") - .getInt(pollutionPerSecondMultiAdvImplosion); - pollutionPerSecondMultiABS = config - .get( - "pollution", - "pollutionPerSecondMultiABS", - pollutionPerSecondMultiABS, - "pollution rate in gibbl/s for the Alloy blast furnace") - .getInt(pollutionPerSecondMultiABS); - pollutionPerSecondMultiCyclotron = config - .get( - "pollution", - "pollutionPerSecondMultiCyclotron", - pollutionPerSecondMultiCyclotron, - "pollution rate in gibbl/s for the Cyclotron") - .getInt(pollutionPerSecondMultiCyclotron); - pollutionPerSecondMultiIndustrialFishingPond = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialFishingPond", - pollutionPerSecondMultiIndustrialFishingPond, - "pollution rate in gibbl/s for the Zuhai - fishing port") - .getInt(pollutionPerSecondMultiIndustrialFishingPond); - // pollutionPerSecondMultiLargeRocketEngine; - pollutionPerSecondMultiLargeSemiFluidGenerator = config - .get( - "pollution", - "pollutionPerSecondMultiLargeSemiFluidGenerator", - pollutionPerSecondMultiLargeSemiFluidGenerator, - "pollution rate in gibbl/s for the Large semifluid burner") - .getInt(pollutionPerSecondMultiLargeSemiFluidGenerator); - pollutionPerSecondMultiMassFabricator = config - .get( - "pollution", - "pollutionPerSecondMultiMassFabricator", - pollutionPerSecondMultiMassFabricator, - "pollution rate in gibbl/s for the Matter fabrication CPU") - .getInt(pollutionPerSecondMultiMassFabricator); - pollutionPerSecondMultiRefinery = config - .get( - "pollution", - "pollutionPerSecondMultiRefinery", - pollutionPerSecondMultiRefinery, - "pollution rate in gibbl/s for the Reactor fuel processing plant") - .getInt(pollutionPerSecondMultiRefinery); - // pollutionPerSecondMultiGeneratorArray; - pollutionPerSecondMultiIndustrialRockBreaker = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialRockBreaker", - pollutionPerSecondMultiIndustrialRockBreaker, - "pollution rate in gibbl/s for the Industrial Rock Breaker") - .getInt(pollutionPerSecondMultiIndustrialRockBreaker); - pollutionPerSecondMultiIndustrialChisel = config - .get( - "pollution", - "pollutionPerSecondMultiIndustrialChisel", - pollutionPerSecondMultiIndustrialChisel, - "pollution rate in gibbl/s for the Industrial Chisel") - .getInt(pollutionPerSecondMultiIndustrialChisel); - pollutionPerSecondMultiTreeFarm = config - .get( - "pollution", - "pollutionPerSecondMultiTreeFarm", - pollutionPerSecondMultiTreeFarm, - "pollution rate in gibbl/s for the Tree growth simulator") - .getInt(pollutionPerSecondMultiTreeFarm); - pollutionPerSecondMultiFrothFlotationCell = config - .get( - "pollution", - "pollutionPerSecondMultiFrothFlotationCell", - pollutionPerSecondMultiFrothFlotationCell, - "pollution rate in gibbl/s for the Flotation cell regulator") - .getInt(pollutionPerSecondMultiFrothFlotationCell); - pollutionPerSecondMultiAutoCrafter = config - .get( - "pollution", - "pollutionPerSecondMultiAutoCrafter", - pollutionPerSecondMultiAutoCrafter, - "pollution rate in gibbl/s for the Large-Scale auto assembler v1.01") - .getInt(pollutionPerSecondMultiAutoCrafter); - pollutionPerSecondMultiMolecularTransformer = config - .get( - "pollution", - "pollutionPerSecondMultiMolecularTransformer", - pollutionPerSecondMultiMolecularTransformer, - "pollution rate in gibbl/s for the Multiblock Molecular Transformer") - .getInt(pollutionPerSecondMultiMolecularTransformer); - 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(); - - // Visual - enableAnimatedTextures = config - .getBoolean("enableAnimatedTextures", "visual", true, "Enables Animated GT++ Textures, Requires Restart"); - config.save(); - } -} diff --git a/src/main/java/gtPlusPlus/core/config/Configuration.java b/src/main/java/gtPlusPlus/core/config/Configuration.java new file mode 100644 index 0000000000..e2cd0463f1 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/config/Configuration.java @@ -0,0 +1,261 @@ +package gtPlusPlus.