diff options
Diffstat (limited to 'src/main/java')
38 files changed, 544 insertions, 585 deletions
diff --git a/src/main/java/bartworks/API/APIConfigValues.java b/src/main/java/bartworks/API/APIConfigValues.java deleted file mode 100644 index 7ab0326802..0000000000 --- a/src/main/java/bartworks/API/APIConfigValues.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.API; - -public class APIConfigValues { - - // One-Side-Only - public static boolean debugLog = true; -} diff --git a/src/main/java/bartworks/MainMod.java b/src/main/java/bartworks/MainMod.java index 7356fa9cc8..acf652c352 100644 --- a/src/main/java/bartworks/MainMod.java +++ b/src/main/java/bartworks/MainMod.java @@ -25,7 +25,6 @@ import net.minecraftforge.common.MinecraftForge; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import bartworks.API.APIConfigValues; import bartworks.API.BioObjectAdder; import bartworks.API.BioVatLogicAdder; import bartworks.API.SideReference; @@ -34,7 +33,7 @@ import bartworks.client.creativetabs.BartWorksTab; import bartworks.client.creativetabs.BioTab; import bartworks.client.creativetabs.GT2Tab; import bartworks.client.textures.PrefixTextureLinker; -import bartworks.common.configs.ConfigHandler; +import bartworks.common.configs.Configuration; import bartworks.common.items.BWItemBlocks; import bartworks.common.loaders.ArtificialMicaLine; import bartworks.common.loaders.BioCultureLoader; @@ -53,7 +52,6 @@ import bartworks.system.material.CircuitGeneration.CircuitPartLoader; import bartworks.system.material.Werkstoff; import bartworks.system.material.WerkstoffLoader; import bartworks.system.material.gtenhancement.PlatinumSludgeOverHaul; -import bartworks.system.material.processingLoaders.DownTierLoader; import bartworks.system.oredict.OreDictHandler; import bartworks.util.ResultWrongSievert; import bartworks.util.log.DebugLog; @@ -75,17 +73,22 @@ import gregtech.api.enums.Mods; import gregtech.api.recipe.RecipeMap; import gregtech.api.recipe.check.CheckRecipeResultRegistry; -@Mod(modid = MainMod.MOD_ID, name = MainMod.NAME, version = GT_Version.VERSION, dependencies = """ - required-after:IC2;\ - required-after:gregtech;\ - after:berriespp;\ - after:tectech;\ - after:GalacticraftMars;\ - after:GalacticraftCore;\ - after:Forestry;\ - after:ProjRed|Illumination;\ - after:RandomThings;\ - before:miscutils;""") +@Mod( + modid = MainMod.MOD_ID, + name = MainMod.NAME, + version = GT_Version.VERSION, + guiFactory = "bartworks.client.gui.BWGuiFactory", + dependencies = """ + required-after:IC2;\ + required-after:gregtech;\ + after:berriespp;\ + after:tectech;\ + after:GalacticraftMars;\ + after:GalacticraftCore;\ + after:Forestry;\ + after:ProjRed|Illumination;\ + after:RandomThings;\ + before:miscutils;""") public final class MainMod { public static final String NAME = "BartWorks"; @@ -97,6 +100,8 @@ public final class MainMod { public static final CreativeTabs BWT = new BartWorksTab(BartWorks.ID); public static final IGuiHandler GH = new GuiHandler(); + public static final boolean DEBUG = Boolean.getBoolean("bw.debug"); + @Mod.Instance(MainMod.MOD_ID) public static MainMod instance; @@ -108,12 +113,10 @@ public final class MainMod { @Mod.EventHandler public void preInit(FMLPreInitializationEvent preinit) { - MainMod.LOGGER.info("Found GT++, continuing"); - GameRegistry.registerBlock(ItemRegistry.bw_glasses[0], BWItemBlocks.class, "BW_GlasBlocks"); GameRegistry.registerBlock(ItemRegistry.bw_glasses[1], BWItemBlocks.class, "BW_GlasBlocks2"); - if (APIConfigValues.debugLog) { + if (DEBUG) { try { DebugLog.initDebugLog(preinit); } catch (IOException e) { @@ -136,7 +139,7 @@ public final class MainMod { @Mod.EventHandler public void init(FMLInitializationEvent init) { - if (SideReference.Side.Client && ConfigHandler.tooltips) + if (SideReference.Side.Client && Configuration.tooltip.addGlassTierInTooltips) MinecraftForge.EVENT_BUS.register(new TooltipEventHandler()); ServerEventHandler serverEventHandler = new ServerEventHandler(); if (SideReference.Side.Server) { @@ -177,7 +180,7 @@ public final class MainMod { @Mod.EventHandler public void onServerStarted(FMLServerStartedEvent event) { - MainMod.runOnPlayerJoined(ConfigHandler.classicMode, ConfigHandler.disableExtraGassesForEBF); + MainMod.runOnPlayerJoined(false, false); } @Mod.EventHandler @@ -198,10 +201,7 @@ public final class MainMod { CircuitImprintLoader.run(); BioVatLogicAdder.RadioHatch.runBasicItemIntegration(); if (!recipesAdded) { - if (!disableExtraGasRecipes) StaticRecipeChangeLoaders.addEBFGasRecipes(); - - if (classicMode) DownTierLoader.run(); - + StaticRecipeChangeLoaders.addEBFGasRecipes(); recipesAdded = true; } diff --git a/src/main/java/bartworks/client/gui/BWGuiFactory.java b/src/main/java/bartworks/client/gui/BWGuiFactory.java new file mode 100644 index 0000000000..3f8cc978af --- /dev/null +++ b/src/main/java/bartworks/client/gui/BWGuiFactory.java @@ -0,0 +1,13 @@ +package bartworks.client.gui; + +import net.minecraft.client.gui.GuiScreen; + +import com.gtnewhorizon.gtnhlib.config.SimpleGuiFactory; + +public class BWGuiFactory implements SimpleGuiFactory { + + @Override + public Class<? extends GuiScreen> mainConfigGuiClass() { + return ConfigGUI.class; + } +} diff --git a/src/main/java/bartworks/client/gui/ConfigGUI.java b/src/main/java/bartworks/client/gui/ConfigGUI.java new file mode 100644 index 0000000000..1d11b7e8fb --- /dev/null +++ b/src/main/java/bartworks/client/gui/ConfigGUI.java @@ -0,0 +1,17 @@ +package bartworks.client.gui; + +import static gregtech.api.enums.Mods.BartWorks; + +import net.minecraft.client.gui.GuiScreen; + +import com.gtnewhorizon.gtnhlib.config.ConfigException; +import com.gtnewhorizon.gtnhlib.config.SimpleGuiConfig; + +import bartworks.common.configs.Configuration; + +public class ConfigGUI extends SimpleGuiConfig { + + public ConfigGUI(GuiScreen parentScreen) throws ConfigException { + super(parentScreen, BartWorks.ID, "BartWorks", Configuration.class); + } +} diff --git a/src/main/java/bartworks/common/commands/ChangeConfig.java b/src/main/java/bartworks/common/commands/ChangeConfig.java deleted file mode 100644 index 8e7edc765f..0000000000 --- a/src/main/java/bartworks/common/commands/ChangeConfig.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.common.commands; - -import java.lang.reflect.Field; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.ChatComponentText; - -import bartworks.common.configs.ConfigHandler; - -public class ChangeConfig extends CommandBase { - - @Override - public String getCommandName() { - return "bwcfg"; - } - - @Override - public String getCommandUsage(ICommandSender sender) { - return "bwcfg <NameOfVariable> <newValue>"; - } - - @Override - @SuppressWarnings("rawtypes") - public void processCommand(ICommandSender sender, String[] args) { - try { - Field f = ConfigHandler.class.getField(args[0]); - Class c = f.getType(); - if (c.equals(int.class)) { - int l; - try { - l = Integer.parseInt(args[1]); - } catch (NumberFormatException e) { - sender.addChatMessage(new ChatComponentText("you need to enter a number!")); - return; - } - f.setInt(null, l); - } else if (c.equals(long.class)) { - long l; - try { - l = Long.parseLong(args[1]); - } catch (NumberFormatException e) { - sender.addChatMessage(new ChatComponentText("you need to enter a number!")); - return; - } - f.setLong(null, l); - } else if (c.equals(boolean.class)) { - if ("true".equalsIgnoreCase(args[1]) || "1".equalsIgnoreCase(args[1])) f.setBoolean(null, true); - else if ("false".equalsIgnoreCase(args[1]) || "0".equalsIgnoreCase(args[1])) f.setBoolean(null, false); - else { - sender.addChatMessage(new ChatComponentText("booleans need to be set to true or false")); - } - } - sender.addChatMessage(new ChatComponentText("Set " + args[0] + " to " + args[1])); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/java/bartworks/common/configs/ConfigHandler.java b/src/main/java/bartworks/common/configs/ConfigHandler.java deleted file mode 100644 index e378819ad1..0000000000 --- a/src/main/java/bartworks/common/configs/ConfigHandler.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following - * conditions: The above copyright notice and this permission notice shall be included in all copies or substantial - * portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package bartworks.common.configs; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import net.minecraftforge.common.config.Configuration; - -import bartworks.API.APIConfigValues; - -public class ConfigHandler { - - public static Configuration c; - - public static int megaMachinesMax = 256; - public static int mbWaterperSec = 150; - public static int ross128BID = -64; - public static int ross128BAID = -63; - public static int ross128btier = 3; - public static int ross128batier = 3; - public static int landerType = 3; - public static int ross128bRuinChance = 512; - public static int bioVatMaxParallelBonus = 1000; - public static int cutoffTier = 5; - public static int[][][] metasForTiers; - - public static long energyPerCell = 1000000L; - - public static boolean Ross128Enabled = true; - - public static boolean disableExtraGassesForEBF; - public static boolean disableMagicalForest; - public static boolean DEHPDirectSteam; - public static boolean teslastaff; - public static boolean classicMode; - - public static boolean GTppLogDisabler; - public static boolean tooltips = true; - public static boolean sharedItemStackTooltip = true; - public static boolean[] enabledPatches; - - public static byte maxTierRoss; - - public static boolean disableBoltedBlocksCasing = false; - public static boolean disableReboltedBlocksCasing = false; - - public static int pollutionHeatedWaterPumpSecond = 5; - public static int basePollutionMBFSecond = 400; - - public static Set<String> voidMinerBlacklist = Collections.unmodifiableSet(new HashSet<>()); - - public static boolean disablePistonInEIC = false; - - private static final int[][] METAFORTIERS_ENERGY = { { 100, 101, 102, 105 }, { 1110, 1115, 1120, 1127 }, - { 1111, 12726, 1116, 1121, 1128 }, { 1112, 12727, 1117, 1122, 1129 }, { 12728, 1190, 1130, 12685 }, - { 1191, 1174, 695, 12686 }, }; - private static final int[][] METAFORTIERS_BUFFER = { { 5133, 5123 }, { 161, 171, 181, 191 }, { 162, 172, 182, 192 }, - { 163, 173, 183, 193 }, { 164, 174, 184, 194 }, { 165, 175, 185, 195 }, }; - private static final int[][] METAFORTIERS_CABLE = { { 5133, 5123 }, { 1210, 1230, 1250, 1270, 1290 }, - { 1310, 1330, 1350, 1370, 1390 }, { 1410, 1430, 1450, 1470, 1490 }, { 1510, 1530, 1550, 1570, 1590 }, - { 1650, 1670, 1690 }, }; - private static final int[][] METAFORTIERS_MACHINE = { - { 103, 104, 106, 107, 109, 110, 112, 113, 115, 116, 118, 119 }, - { 201, 211, 221, 231, 241, 251, 261, 271, 281, 291, 301, 311, 321, 331, 341, 351, 361, 371, 381, 391, 401, 411, - 421, 431, 441, 451, 461, 471, 481, 491, 501, 511, 521, 531, 541, 551, 561, 571, 581, 591, 601, 611, 621, - 631, 641, 651, 661, 671 }, - { 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 302, 312, 322, 332, 342, 352, 362, 372, 382, 392, 402, 412, - 422, 432, 442, 452, 462, 472, 482, 492, 502, 512, 522, 532, 542, 552, 562, 572, 582, 592, 602, 612, 622, - 632, 642, 652, 662, 672 }, - { 203, 213, 223, 233, 243, 253, 263, 273, 283, 293, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 403, 413, - 423, 433, 443, 453, 463, 473, 483, 493, 503, 513, 523, 533, 543, 553, 563, 573, 583, 593, 603, 613, 623, - 633, 643, 653, 663, 673 }, - { 204, 214, 224, 234, 244, 254, 264, 274, 284, 294, 304, 314, 324, 334, 344, 354, 364, 374, 384, 394, 404, 414, - 424, 434, 444, 454, 464, 474, 484, 494, 504, 514, 524, 534, 544, 554, 564, 574, 584, 594, 604, 614, 624, - 634, 644, 654, 664, 674 }, - { 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 405, 415, - 425, 435, 445, 455, 465, 475, 485, 495, 505, 515, 525, 535, 545, 555, 565, 575, 585, 595, 605, 615, 625, - 635, 645, 655, 665, 675 }, }; - private static int[][][] defaultMetasForTiers = { METAFORTIERS_ENERGY, METAFORTIERS_BUFFER, METAFORTIERS_CABLE, - METAFORTIERS_MACHINE }; - private static final String[] VOLTAGE_NAMES = { "High Pressure Steam", "Low Voltage", "Medium Voltage", - "High Voltage", "Extreme Voltage", "Insane Voltage", "Ludicrous Voltage", "ZPM Voltage", "Ultimate Voltage", - "Ultimate High Voltage", "Ultimate Extreme Voltage", "Ultimate Insane Voltage", "Ultimate Mega Voltage", - "Ultimate Extended Mega Voltage", "Overpowered Voltage", "Maximum Voltage" }; - private static final String[] names = { "Generators", "Buffers", "Cables", "Machines" }; - - public static final String[] ASM_TRANSFORMER_DESCRIPTIONS = { "REMOVING RAIN FROM LAST MILLENNIUM (EXU)", - "REMOVING CREATURES FROM LAST MILLENNIUM (EXU)", "PATCHING THAUMCRAFT WAND PEDESTAL TO PREVENT VIS DUPLICATION", - "PATCHING CRAFTING MANAGER FOR CACHING RECIPES" }; - public static final String[] ASM_TRANSFORMER_CLASSES = { - "com.rwtema.extrautils.worldgen.endoftime.WorldProviderEndOfTime", - "com.rwtema.extrautils.worldgen.endoftime.ChunkProviderEndOfTime", "thaumcraft.common.tiles.TileWandPedestal", - "net.minecraft.item.crafting.CraftingManager" }; - - public ConfigHandler(Configuration C) { - ConfigHandler.c = C; - ConfigHandler.classicMode = ConfigHandler.c - .get( - "System", - "Enable Classic Mode", - false, - "Enables the classic Mode (all recipes in normal machines are doable in MV") - .getBoolean(false); - - ConfigHandler.tooltips = ConfigHandler.c - .get("System", "BartWorksToolTips", true, "If you wish to enable extra tooltips") - .getBoolean(true); - ConfigHandler.sharedItemStackTooltip = ConfigHandler.c - .get( - "System", - "BartWorksSharedItemStackToolTips", - true, - "If you wish to enable \"Shared Item Stack\" tooltips") - .getBoolean(true); - - ConfigHandler.teslastaff = ConfigHandler.c - .get( - "System", - "Enable Teslastaff", - false, - "Enables the Teslastaff, an Item used to destroy Electric Armors") - .getBoolean(false); - - ConfigHandler.cutoffTier = ConfigHandler.c - .get( - "System", - "Tier to nerf circuits", - 5, - "This switch sets the lowest unnerfed Circuit Recipe Tier. -1 to disable it completely.", - -1, - VOLTAGE_NAMES.length) - .getInt(5); - ConfigHandler.cutoffTier = ConfigHandler.cutoffTier == -1 ? VOLTAGE_NAMES.length : ConfigHandler.cutoffTier; - ConfigHandler.disableExtraGassesForEBF = ConfigHandler.c - .get( - "System", - "Disable Extra Gases for EBF", - false, - "This switch disables extra gas recipes for the EBF, i.e. Xenon instead of Nitrogen") - .getBoolean(false); - ConfigHandler.disableBoltedBlocksCasing = ConfigHandler.c - .get("System", "Disable Bolted Casings", false, "This switch disable the generation of bolted casings") - .getBoolean(false); - ConfigHandler.disableReboltedBlocksCasing = ConfigHandler.c - .get("System", "Disable Rebolted Casings", false, "This switch disable the generation of rebolted casings") - .getBoolean(false); - - ConfigHandler.mbWaterperSec = ConfigHandler.c.get("Singleblocks", "mL Water per Sec for the StirlingPump", 150) - .getInt(150); - - ConfigHandler.energyPerCell = ConfigHandler.c - .get( - "Multiblocks", - "energyPerLESUCell", - 1000000, - "This will set Up the Energy per LESU Cell", - 1000000, - Integer.MAX_VALUE) - .getInt(1000000); - ConfigHandler.DEHPDirectSteam = ConfigHandler.c.get( - "Multiblocks", - "DEHP Direct Steam Mode", - false, - "This switch enables the Direct Steam Mode of the DEHP. If enabled it will take in Waterand output steam. If disabled it will Input IC2Coolant and output hot coolant") - .getBoolean(false); - ConfigHandler.megaMachinesMax = ConfigHandler.c - .get( - "Multiblocks", - "Mega Machines Maximum Recipes per Operation", - 256, - "This changes the Maximum Recipes per Operation to the specified Valure") - .getInt(256); - ConfigHandler.bioVatMaxParallelBonus = ConfigHandler.c - .get( - "Multiblocks", - "BioVat Maximum Bonus on Recipes", - 1000, - "This are the maximum parallel Operations the BioVat can do, when the output is half full.") - .getInt(1000); - ConfigHandler.voidMinerBlacklist = Collections.unmodifiableSet( - new HashSet<>( - Arrays.asList( - ConfigHandler.c.get( - "Multiblocks", - "Void Miner Blacklist", - new String[0], - "This is a blacklist for the Void Miner, blacklisted ores will not enter the drop prize pool. Please fill in the Unique Identifier of Ore and connect Damage with a colon, For example: gregtech:gt.blockores:32") - .getStringList()))); - ConfigHandler.disablePistonInEIC = ConfigHandler.c - .get( - "Multiblocks", - "Disable Electric Implosion Compressor piston", - false, - "This switch completely disables piston animation in Electric Implosion Compressor multiblock") - .getBoolean(false); - - ConfigHandler.pollutionHeatedWaterPumpSecond = ConfigHandler.c - .get( - "Pollution", - "Pollution produced per second by the water pump", - ConfigHandler.pollutionHeatedWaterPumpSecond, - "How much should the Simple Stirling Water Pump produce pollution per second") - .getInt(ConfigHandler.pollutionHeatedWaterPumpSecond); - ConfigHandler.basePollutionMBFSecond = ConfigHandler.c.get( - "Pollution", - "Pollution produced per tick by the MBF per ingot", - ConfigHandler.basePollutionMBFSecond, - "How much should the MBF produce pollution per tick per ingot. Then it'll be multiplied by the amount of ingots done in parallel") - .getInt(ConfigHandler.basePollutionMBFSecond); - - ConfigHandler.GTppLogDisabler = ConfigHandler.c - .get("System", "Disable GT++ Logging", false, "Enables or Disables GT++ Logging.") - .getBoolean(false); - APIConfigValues.debugLog = ConfigHandler.c - .get("System", "Enable Debug Log", false, "Enables or Disables the debug log.") - .getBoolean(false); - - ConfigHandler.enabledPatches = new boolean[ASM_TRANSFORMER_CLASSES.length]; - for (int i = 0; i < ASM_TRANSFORMER_CLASSES.length; i++) ConfigHandler.enabledPatches[i] = ConfigHandler.c - .get("ASM fixes", ASM_TRANSFORMER_DESCRIPTIONS[i] + " in class: " + ASM_TRANSFORMER_CLASSES[i], true) - .getBoolean(true); - - ConfigHandler.ross128BID = ConfigHandler.c - .get("CrossMod Interactions", "DimID - Ross128b", -64, "The Dim ID for Ross128b") - .getInt(-64); - ConfigHandler.ross128BAID = ConfigHandler.c - .get("CrossMod Interactions", "DimID - Ross128ba", -63, "The Dim ID for Ross128ba (Ross128b's Moon)") - .getInt(-63); - ConfigHandler.ross128btier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128b", 3, "The Rocket Tier for Ross128b") - .getInt(3); - ConfigHandler.ross128batier = ConfigHandler.c - .get("CrossMod Interactions", "Rocket Tier - Ross128ba", 3, "The Rocket Tier for Ross128a") - .getInt(3); - ConfigHandler.ross128bRuinChance = ConfigHandler.c - .get("CrossMod Interactions", "Ruin Chance - Ross128b", 512, "Higher Values mean lesser Ruins.") - .getInt(512); - ConfigHandler.Ross128Enabled = ConfigHandler.c - .get( - "CrossMod Interactions", - "Galacticraft - Activate Ross128 System", - true, - "If the Ross128 System should be activated, DO NOT CHANGE AFTER WORLD GENERATION") - .getBoolean(true); - ConfigHandler.landerType = ConfigHandler.c - .get("CrossMod Interactions", "LanderType", 3, "1 = Moon Lander, 2 = Landing Balloons, 3 = Asteroid Lander") - .getInt(3); - ConfigHandler.disableMagicalForest = ConfigHandler.c - .get( - "CrossMod Interactions", - "Disable Magical Forest - Ross128b", - false, - "True disables the magical Forest Biome on Ross for more performance during World generation.") - .getBoolean(false); - - ConfigHandler.maxTierRoss = (byte) ConfigHandler.c - .get("Ross Ruin Metas", "A_Ruin Machine Tiers", 6, "", 0, VOLTAGE_NAMES.length) - .getInt(6); - ConfigHandler.metasForTiers = new int[4][maxTierRoss][]; - - for (int i = 0; i < 4; i++) { - if (maxTierRoss > ConfigHandler.defaultMetasForTiers[i].length) - ConfigHandler.defaultMetasForTiers[i] = new int[maxTierRoss][0]; - for (int j = 0; j < maxTierRoss; j++) ConfigHandler.metasForTiers[i][j] = ConfigHandler.c - .get( - "Ross Ruin Metas", - j + "_Ruin " + names[i] + " Tier " + VOLTAGE_NAMES[j], - ConfigHandler.defaultMetasForTiers[i][j]) - .getIntList(); - } - - ConfigHandler.setUpComments(); - - if (ConfigHandler.c.hasChanged()) ConfigHandler.c.save(); - } - - private static void setUpComments() { - ConfigHandler.c.addCustomCategoryComment("ASM fixes", "Disable ASM fixes here."); - ConfigHandler.c.addCustomCategoryComment("Singleblocks", "Singleblock Options can be set here."); - ConfigHandler.c.addCustomCategoryComment("Multiblocks", "Multiblock Options can be set here."); - ConfigHandler.c.addCustomCategoryComment("System", "Different System Settings can be set here."); - ConfigHandler.c.addCustomCategoryComment( - "CrossMod Interactions", - "CrossMod Interaction Settings can be set here. For Underground Fluid settings change the Gregtech.cfg!"); - ConfigHandler.c.addCustomCategoryComment("Ross Ruin Metas", "Ruin Metas and Tiers can be set here."); - } -} diff --git a/src/main/java/bartworks/common/configs/Configuration.java b/src/main/java/bartworks/common/configs/Configuration.java new file mode 100644 index 0000000000..813c825dce --- /dev/null +++ b/src/main/java/bartworks/common/configs/Configuration.java @@ -0,0 +1,245 @@ +package bartworks.common.configs; + +import com.gtnewhorizon.gtnhlib.config.Config; + +import gregtech.api.enums.Mods; + +@Config(modid = Mods.Names.BART_WORKS, filename = "bartworks") +@Config.LangKeyPattern(patte |
