From 5a90d0ab107b4711b2b22aa3b2964ce7d669a216 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Sun, 10 Dec 2017 15:37:46 +1000 Subject: % Major Refactor of the base GT++ class. % Moved Config Handling to it's own class. % Renamed configSwitches.class to ConfigSwitches.class. + Added framework for Segment Analytics. --- src/Java/gtPlusPlus/GTplusplus.java | 203 ++------------------- .../api/analytics/AnalyticsLoggingPlugin.java | 37 ++++ .../gtPlusPlus/api/analytics/BlockingFlush.java | 67 +++++++ src/Java/gtPlusPlus/core/common/CommonProxy.java | 6 +- .../core/common/compat/COMPAT_ExtraUtils.java | 4 +- .../gtPlusPlus/core/common/compat/COMPAT_IC2.java | 4 +- .../core/common/compat/COMPAT_Thaumcraft.java | 4 +- src/Java/gtPlusPlus/core/config/ConfigHandler.java | 166 +++++++++++++++++ .../gtPlusPlus/core/handler/OldCircuitHandler.java | 50 +++++ .../core/handler/events/BlockEventHandler.java | 4 +- .../core/handler/events/LoginEventHandler.java | 2 +- src/Java/gtPlusPlus/core/item/ModItems.java | 10 +- .../core/item/base/BaseItemComponent.java | 2 +- .../core/item/base/cell/BaseItemCell.java | 6 +- .../core/item/base/dusts/BaseItemDust.java | 2 +- .../core/item/base/dusts/BaseItemDustUnique.java | 2 +- .../core/item/base/ingots/BaseItemIngotHot.java | 8 +- .../gtPlusPlus/core/item/init/ItemsMultiTools.java | 2 +- src/Java/gtPlusPlus/core/lib/CORE.java | 8 +- src/Java/gtPlusPlus/core/lib/LoadedMods.java | 4 +- src/Java/gtPlusPlus/core/proxy/ClientProxy.java | 10 +- .../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 2 +- .../core/recipe/RECIPES_LaserEngraver.java | 6 +- .../core/recipe/RECIPES_MachineComponents.java | 2 +- .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 52 +++--- .../core/recipe/RECIPES_Old_Circuits.java | 2 +- src/Java/gtPlusPlus/core/recipe/common/CI.java | 4 +- src/Java/gtPlusPlus/core/util/Utils.java | 2 +- src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 20 +- .../gregtech/common/helpers/TreeFarmHelper.java | 2 +- .../common/items/MetaGeneratedGregtechItems.java | 4 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 2 +- .../registration/gregtech/Gregtech4Content.java | 2 +- .../registration/gregtech/GregtechConduits.java | 4 +- .../registration/gregtech/GregtechDehydrator.java | 2 +- .../gregtech/GregtechEnergyBuffer.java | 2 +- .../GregtechGeothermalThermalGenerator.java | 2 +- .../gregtech/GregtechIndustrialBlastSmelter.java | 2 +- .../gregtech/GregtechIndustrialCentrifuge.java | 2 +- .../gregtech/GregtechIndustrialCokeOven.java | 2 +- .../gregtech/GregtechIndustrialCuttingFactory.java | 2 +- .../gregtech/GregtechIndustrialElectrolyzer.java | 2 +- .../gregtech/GregtechIndustrialFuelRefinery.java | 2 +- .../gregtech/GregtechIndustrialGeneratorArray.java | 2 +- .../gregtech/GregtechIndustrialMacerator.java | 2 +- .../gregtech/GregtechIndustrialMassFabricator.java | 2 +- .../gregtech/GregtechIndustrialMultiTank.java | 2 +- .../gregtech/GregtechIndustrialPlatePress.java | 2 +- .../gregtech/GregtechIndustrialSifter.java | 2 +- .../GregtechIndustrialThermalCentrifuge.java | 2 +- .../gregtech/GregtechIndustrialTreeFarm.java | 2 +- .../gregtech/GregtechIndustrialWashPlant.java | 2 +- .../gregtech/GregtechIndustrialWiremill.java | 2 +- .../gregtech/GregtechIronBlastFurnace.java | 2 +- .../registration/gregtech/GregtechLFTR.java | 2 +- .../gregtech/GregtechMiniRaFusion.java | 2 +- .../gregtech/GregtechNitroDieselFix.java | 2 +- .../gregtech/GregtechPollutionDevices.java | 2 +- .../gregtech/GregtechPowerSubStation.java | 2 +- .../gregtech/GregtechRocketFuelGenerator.java | 2 +- .../registration/gregtech/GregtechSafeBlock.java | 2 +- .../gregtech/GregtechSimpleWasher.java | 2 +- .../gregtech/GregtechSolarGenerators.java | 6 +- .../gregtech/GregtechSteamCondenser.java | 2 +- .../gregtech/GregtechTieredFluidTanks.java | 2 +- .../gregtech/GregtechTreeFarmerTE.java | 2 +- .../gregtech/NewHorizonsAccelerator.java | 2 +- 67 files changed, 475 insertions(+), 300 deletions(-) create mode 100644 src/Java/gtPlusPlus/api/analytics/AnalyticsLoggingPlugin.java create mode 100644 src/Java/gtPlusPlus/api/analytics/BlockingFlush.java create mode 100644 src/Java/gtPlusPlus/core/config/ConfigHandler.java create mode 100644 src/Java/gtPlusPlus/core/handler/OldCircuitHandler.java (limited to 'src/Java/gtPlusPlus') diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index c3d2242e30..21185910a4 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -1,17 +1,11 @@ package gtPlusPlus; import static gtPlusPlus.core.lib.CORE.DEBUG; -import static gtPlusPlus.core.lib.CORE.configSwitches.*; -import static gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.io.File; -import java.lang.reflect.Field; import java.util.Collection; -import java.util.HashSet; - -import org.apache.commons.lang3.reflect.FieldUtils; import cpw.mods.fml.common.*; import cpw.mods.fml.common.Mod.EventHandler; @@ -19,196 +13,45 @@ import cpw.mods.fml.common.event.*; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import gregtech.api.util.EmptyRecipeMap; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map; +import gtPlusPlus.api.analytics.SegmentAnalytics; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.commands.CommandMath; import gtPlusPlus.core.common.CommonProxy; +import gtPlusPlus.core.config.ConfigHandler; import gtPlusPlus.core.handler.BookHandler; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; import gtPlusPlus.core.handler.events.BlockEventHandler; import gtPlusPlus.core.handler.events.LoginEventHandler; -import gtPlusPlus.core.item.general.RF2EU_Battery; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.CORE.configSwitches; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.geo.GeoUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.networking.NetworkUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; import net.minecraft.item.Item; import net.minecraft.launchwrapper.Launch; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.oredict.OreDictionary; @MCVersion(value = "1.7.10") @Mod(modid = CORE.MODID, name = CORE.name, version = CORE.VERSION, dependencies = "required-after:Forge; after:PlayerAPI; after:dreamcraft; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO;") public class GTplusplus implements ActionListener { + //Mod Instance @Mod.Instance(CORE.MODID) public static GTplusplus instance; + //GT_Proxy instance protected static Meta_GT_Proxy gregtechproxy; + //GT++ Proxy Instances @SidedProxy(clientSide = "gtPlusPlus.core.proxy.ClientProxy", serverSide = "gtPlusPlus.core.proxy.ServerProxy") public static CommonProxy proxy; - public static void handleConfigFile(final FMLPreInitializationEvent event) { - final Configuration config = new Configuration( - new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); - config.load(); - - configSwitches.enableUpdateChecker = config.getBoolean("enableUpdateChecker", "debug", true, - "Stops mod checking for updates."); - - // Debug - DEBUG = config.getBoolean("debugMode", "debug", false, - "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"); - disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, - "Disables EnderIO Integration."); - 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."); - - - // Machines - enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, - "Allows the use of TC shards across many recipes by oreDicting them into a common group."); - enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, - "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); - disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, - "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); - enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", - false, "Utilizes Neutronium instead."); - - //Circuits - enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", true, - "Adds custom circuits to expand past the Master Tier."); - enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, - "Restores circuits and their recipes from Pre-5.09.28 times."); - - // Tools - enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, - "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench."); - enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, - "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); - - // GT-Fixes - enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false, - "Restores the old Nitro-Diesel recipes."); - - // Pipes & Cables - enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, - "Adds Custom GT Fluid Pipes."); - enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, - "Adds Custom GT Cables."); - - // Block Drops - chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, - 10000, "Drained shards have a 1 in X chance to drop."); - chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, - 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); - - // Single machines - enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", - false, "These may be overpowered, Consult a local electrician."); - enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, - "These protect your goodies/rare stuff."); - enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true, - "These dehydrate stuff."); - enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech", - true, "Converts IC2 steam -> Railcraft steam."); - enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, - "Portable fluid tanks."); - enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", - true, "Diesel egines with different internals, they consume less fuel overall."); - enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", - "gregtech", true, "These may be overpowered, Consult a local geologist."); - enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators", - "gregtech", true, "These allow boosting Block/TileEntity Tick times [OP]."); - enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts", - "gregtech", true, "Tesseracts for wireless item/fluid movement."); - enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher", - "gregtech", true, "Very basic automated cauldron for dust washing."); - enableMachine_Pollution = config.getBoolean("enableMachinePollution", - "gregtech", true, "Pollution Detector & Scrubbers."); - - // Multi machines - enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", - "gregtech", true, - "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); - enableMultiblock_IndustrialCentrifuge = config - .getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin."); - enableMultiblock_IndustrialCokeOven = config.getBoolean( - "enableMultiblockIndustrialCokeOven", "gregtech", true, - "Pyro Oven Alternative, older, more realistic, better."); - enableMultiblock_IndustrialElectrolyzer = config.getBoolean( - "enableMultiblockIndustrialElectrolyzer", "gregtech", true, - "Electrolyzes things with extra bling factor."); - enableMultiblock_IndustrialMacerationStack = config.getBoolean( - "enableMultiblockIndustrialMacerationStack", "gregtech", true, - "A hyper efficient maceration tower, nets more bonus outputs."); - enableMultiblock_IndustrialPlatePress = config.getBoolean( - "enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo."); - enableMultiblock_IndustrialWireMill = config.getBoolean( - "enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables."); - enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace", - "gregtech", true, "Skip the Bronze age, very slowly."); - enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator", - "gregtech", true, "?FAB?RIC?ATE MA?TT?ER."); - enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech", - true, "Tall tanks, each layer adds extra fluid storage."); - enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", - "gregtech", true, "For managing large power grids."); - enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean( - "enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids."); - enableMultiblock_NuclearFuelRefinery = config.getBoolean( - "enableMultiblock_NuclearFuelRefinery", "gregtech", true, - "Refines molten chemicals into nuclear fuels."); - enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", - "gregtech", true, "Large scale sifting."); - enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter", - "gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks."); - enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge", - "gregtech", true, "Your warm spin for the ore thing."); - enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant", - "gregtech", true, "Used to wash the dirt, riiiiight offff.."); - enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", - "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources."); - enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine", - "gregtech", true, "Very fast and efficient Cutting Machine."); - - // Options - RF2EU_Battery.rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, - "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); - - // Features - enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, - "Enables Custom GT++ Cape."); - disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, - "Disables Zombie Reinforcement on hard difficutly."); - - //Biomes - CORE.DARKBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension."); - - //Blacklisted Accelerator TileEntities - BlacklistedTileEntiyClassNames = new String[] { "com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry" }; - BlacklistedTileEntiyClassNames = config.getStringList( - "BlacklistedTileEntiyClassNames", "gregtech", - BlacklistedTileEntiyClassNames, - "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator"); - - - config.save(); - } - // Loads Textures @SideOnly(value = Side.CLIENT) public static void loadTextures() { @@ -229,27 +72,29 @@ public class GTplusplus implements ActionListener { enableCustomCapes = true; } + //Give this a go mate. + initAnalytics(); + //HTTP Requests CORE.MASTER_VERSION = NetworkUtils.getContentFromURL("https://raw.githubusercontent.com/draknyte1/GTplusplus/master/Recommended.txt").toLowerCase(); CORE.USER_COUNTRY = GeoUtils.determineUsersCountry(); // Handle GT++ Config - handleConfigFile(event); + ConfigHandler.handleConfigFile(event); + //Check for Dev CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); if (enableUpdateChecker){ Utils.LOG_INFO("Latest is " + CORE.MASTER_VERSION + ". Updated? " + Utils.isModUpToDate()); } - Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY); + //Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY); // FirstCall(); Utils.registerEvent(new LoginEventHandler()); Utils.LOG_INFO("Login Handler Initialized"); - if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - removeCircuitRecipeMap(); //Bye shitty recipes. - } - + + proxy.preInit(event); } @@ -258,13 +103,13 @@ public class GTplusplus implements ActionListener { public void init(final FMLInitializationEvent event) { proxy.init(event); proxy.registerNetworkStuff(); - + //Set Variables for Fluorite Block handling Utils.LOG_INFO("Setting some Variables for the block break event handler."); BlockEventHandler.oreLimestone = OreDictionary.getOres("oreLimestone"); BlockEventHandler.blockLimestone = OreDictionary.getOres("limestone"); BlockEventHandler.fluoriteOre = ItemUtils.getSimpleStack(Item.getItemFromBlock(ModBlocks.blockOreFluorite)); - + } // Post-Init @@ -322,19 +167,7 @@ public class GTplusplus implements ActionListener { } - private static boolean removeCircuitRecipeMap(){ - try { - Utils.LOG_INFO("[Old Feature - Circuits] Trying to override the Circuit Assembler Recipe map, so that no recipes for new circuits get added."); - ReflectionUtils.setFinalStatic(GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"), new EmptyRecipeMap(new HashSet(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false)); - Field jaffar = GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"); - FieldUtils.removeFinalModifier(jaffar, true); - jaffar.set(null, new EmptyRecipeMap(new HashSet(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false)); - Utils.LOG_INFO("[Old Feature - Circuits] Successfully replaced circuit assembler recipe map with one that cannot hold recipes."); - } - catch (Exception e) { - Utils.LOG_INFO("[Old Feature - Circuits] Failed removing circuit assembler recipe map."); - return false; - } - return true; + private static final void initAnalytics(){ + CORE.mAnalytics = new SegmentAnalytics(); } } diff --git a/src/Java/gtPlusPlus/api/analytics/AnalyticsLoggingPlugin.java b/src/Java/gtPlusPlus/api/analytics/AnalyticsLoggingPlugin.java new file mode 100644 index 0000000000..ec2537cbfd --- /dev/null +++ b/src/Java/gtPlusPlus/api/analytics/AnalyticsLoggingPlugin.java @@ -0,0 +1,37 @@ +package gtPlusPlus.api.analytics; + +import com.segment.analytics.Analytics; +import com.segment.analytics.Callback; +import com.segment.analytics.Log; +import com.segment.analytics.Plugin; +import com.segment.analytics.messages.Message; + +/** + * A {@link Plugin} implementation that redirects client logs to standard output and logs callback + * events. + */ +public class AnalyticsLoggingPlugin implements Plugin { + @Override public void configure(Analytics.Builder builder) { + builder.log(new Log() { + @Override public void print(Level level, String format, Object... args) { + System.out.println(level + ":\t" + String.format(format, args)); + } + + @Override public void print(Level level, Throwable error, String format, Object... args) { + System.out.println(level + ":\t" + String.format(format, args)); + System.out.println(error); + } + }); + + builder.callback(new Callback() { + @Override public void success(Message message) { + System.out.println("Uploaded " + message); + } + + @Override public void failure(Message message, Throwable throwable) { + System.out.println("Could not upload " + message); + System.out.println(throwable); + } + }); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/api/analytics/BlockingFlush.java b/src/Java/gtPlusPlus/api/analytics/BlockingFlush.java new file mode 100644 index 0000000000..7dbf9cba06 --- /dev/null +++ b/src/Java/gtPlusPlus/api/analytics/BlockingFlush.java @@ -0,0 +1,67 @@ +package gtPlusPlus.api.analytics; + +import com.segment.analytics.Analytics; +import com.segment.analytics.Callback; +import com.segment.analytics.MessageTransformer; +import com.segment.analytics.Plugin; +import com.segment.analytics.messages.Message; +import com.segment.analytics.messages.MessageBuilder; +import java.util.concurrent.Phaser; + +/** + * The {@link Analytics} class doesn't come with a blocking {@link Analytics#flush()} implementation + * out of the box. It's trivial to build one using a {@link Phaser} that monitors requests and is + * able to block until they're uploaded. + * + *

+ * BlockingFlush blockingFlush = BlockingFlush.create();
+ * Analytics analytics = Analytics.builder(writeKey)
+ *      .plugin(blockingFlush)
+ *      .build();
+ *
+ * // Do some work.
+ *
+ * analytics.flush(); // Trigger a flush.
+ * blockingFlush.block(); // Block until the flush completes.
+ * analytics.shutdown(); // Shut down after the flush is complete.
+ * 
+ */ +public class BlockingFlush { + + public static BlockingFlush create() { + return new BlockingFlush(); + } + + BlockingFlush() { + this.phaser = new Phaser(1); + } + + final Phaser phaser; + + public Plugin plugin() { + return new Plugin() { + @Override public void configure(Analytics.Builder builder) { + builder.messageTransformer(new MessageTransformer() { + @Override public boolean transform(MessageBuilder builder) { + phaser.register(); + return true; + } + }); + + builder.callback(new Callback() { + @Override public void success(Message message) { + phaser.arrive(); + } + + @Override public void failure(Message message, Throwable throwable) { + phaser.arrive(); + } + }); + } + }; + } + + public void block() { + phaser.arriveAndAwaitAdvance(); + } +} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 10602c613e..1360932dfb 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -13,7 +13,7 @@ import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler; import gtPlusPlus.core.handler.events.ZombieBackupSpawnEventHandler; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.recipe.RECIPES_Old_Circuits; import gtPlusPlus.core.recipe.common.CI; @@ -94,7 +94,7 @@ public class CommonProxy { //Handles Custom tooltips for EIO. Utils.registerEvent(new HandlerTooltip_EIO()); - if (configSwitches.disableZombieReinforcement){ + if (ConfigSwitches.disableZombieReinforcement){ //Make Zombie reinforcements fuck off. Utils.registerEvent(new ZombieBackupSpawnEventHandler()); } @@ -117,7 +117,7 @@ public class CommonProxy { PlayerCache.initCache(); //Circuits - if (CORE.configSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + if (CORE.ConfigSwitches.enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ RECIPES_Old_Circuits.handleCircuits(); new RECIPES_Old_Circuits(); } diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java index d8ff219db7..763ae3f283 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.common.compat; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.recipe.RECIPES_Tools; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.recipe.RecipeUtils; @@ -18,7 +18,7 @@ public class COMPAT_ExtraUtils { ItemUtils.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0); //GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium)); - if (configSwitches.enableAlternativeDivisionSigilRecipe){ + if (ConfigSwitches.enableAlternativeDivisionSigilRecipe){ //Division Sigil RecipeUtils.recipeBuilder( "plateNetherStar", "gemIridium", "plateNetherStar", diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java index ce62eaac5a..74e6d931fd 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.common.compat; import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.recipe.ShapedRecipeObject; import gtPlusPlus.core.util.item.ItemUtils; @@ -37,7 +37,7 @@ public class COMPAT_IC2 { private static final void run(){ - if (configSwitches.disableIC2Recipes){ + if (ConfigSwitches.disableIC2Recipes){ diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java index a257766e38..4fcce4013d 100644 --- a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java +++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.common.compat; import gregtech.api.util.GT_OreDictUnificator; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.item.ItemUtils; @@ -9,7 +9,7 @@ public class COMPAT_Thaumcraft { public static void OreDict(){ - if (configSwitches.enableThaumcraftShardUnification){ + if (ConfigSwitches.enableThaumcraftShardUnification){ run(); } } diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java new file mode 100644 index 0000000000..96bd801ad4 --- /dev/null +++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java @@ -0,0 +1,166 @@ +package gtPlusPlus.core.config; + +import static gtPlusPlus.core.item.general.RF2EU_Battery.rfPerEU; +import static gtPlusPlus.core.lib.CORE.DARKBIOME_ID; +import static gtPlusPlus.core.lib.CORE.DEBUG; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.*; +import static gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames; + +import java.io.File; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; +import net.minecraftforge.common.config.Configuration; + +public class ConfigHandler { + + public static void handleConfigFile(final FMLPreInitializationEvent event) { + final Configuration config = new Configuration( + new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); + config.load(); + + ConfigSwitches.enableUpdateChecker = config.getBoolean("enableUpdateChecker", "debug", true, + "Stops mod checking for updates."); + + // Debug + DEBUG = config.getBoolean("debugMode", "debug", false, + "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)"); + disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, + "Disables EnderIO Integration."); + 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."); + + + // Machines + enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, + "Allows the use of TC shards across many recipes by oreDicting them into a common group."); + enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, + "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); + disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, + "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); + enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", + false, "Utilizes Neutronium instead."); + + //Circuits + enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", true, + "Adds custom circuits to expand past the Master Tier."); + enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, + "Restores circuits and their recipes from Pre-5.09.28 times."); + + // Tools + enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, + "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench."); + enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, + "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); + + // GT-Fixes + enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false, + "Restores the old Nitro-Diesel recipes."); + + // Pipes & Cables + enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, + "Adds Custom GT Fluid Pipes."); + enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, + "Adds Custom GT Cables."); + + // Block Drops + chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, + 10000, "Drained shards have a 1 in X chance to drop."); + chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, + 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); + + // Single machines + enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", + false, "These may be overpowered, Consult a local electrician."); + enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, + "These protect your goodies/rare stuff."); + enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true, + "These dehydrate stuff."); + enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech", + true, "Converts IC2 steam -> Railcraft steam."); + enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, + "Portable fluid tanks."); + enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", + true, "Diesel egines with different internals, they consume less fuel overall."); + enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", + "gregtech", true, "These may be overpowered, Consult a local geologist."); + enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators", + "gregtech", true, "These allow boosting Block/TileEntity Tick times [OP]."); + enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts", + "gregtech", true, "Tesseracts for wireless item/fluid movement."); + enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher", + "gregtech", true, "Very basic automated cauldron for dust washing."); + enableMachine_Pollution = config.getBoolean("enableMachinePollution", + "gregtech", true, "Pollution Detector & Scrubbers."); + + // Multi machines + enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", + "gregtech", true, + "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); + enableMultiblock_IndustrialCentrifuge = config + .getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin."); + enableMultiblock_IndustrialCokeOven = config.getBoolean( + "enableMultiblockIndustrialCokeOven", "gregtech", true, + "Pyro Oven Alternative, older, more realistic, better."); + enableMultiblock_IndustrialElectrolyzer = config.getBoolean( + "enableMultiblockIndustrialElectrolyzer", "gregtech", true, + "Electrolyzes things with extra bling factor."); + enableMultiblock_IndustrialMacerationStack = config.getBoolean( + "enableMultiblockIndustrialMacerationStack", "gregtech", true, + "A hyper efficient maceration tower, nets more bonus outputs."); + enableMultiblock_IndustrialPlatePress = config.getBoolean( + "enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo."); + enableMultiblock_IndustrialWireMill = config.getBoolean( + "enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables."); + enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace", + "gregtech", true, "Skip the Bronze age, very slowly."); + enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator", + "gregtech", true, "?FAB?RIC?ATE MA?TT?ER."); + enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech", + true, "Tall tanks, each layer adds extra fluid storage."); + enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", + "gregtech", true, "For managing large power grids."); + enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean( + "enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids."); + enableMultiblock_NuclearFuelRefinery = config.getBoolean( + "enableMultiblock_NuclearFuelRefinery", "gregtech", true, + "Refines molten chemicals into nuclear fuels."); + enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", + "gregtech", true, "Large scale sifting."); + enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter", + "gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks."); + enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge", + "gregtech", true, "Your warm spin for the ore thing."); + enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant", + "gregtech", true, "Used to wash the dirt, riiiiight offff.."); + enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", + "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources."); + enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine", + "gregtech", true, "Very fast and efficient Cutting Machine."); + + // Options + rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, + "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); + + // Features + enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, + "Enables Custom GT++ Cape."); + disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, + "Disables Zombie Reinforcement on hard difficutly."); + + //Biomes + DARKBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension."); + + //Blacklisted Accelerator TileEntities + BlacklistedTileEntiyClassNames = new String[] { "com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry" }; + BlacklistedTileEntiyClassNames = config.getStringList( + "BlacklistedTileEntiyClassNames", "gregtech", + BlacklistedTileEntiyClassNames, + "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator"); + + config.save(); + } + +} diff --git a/src/Java/gtPlusPlus/core/handler/OldCircuitHandler.java b/src/Java/gtPlusPlus/core/handler/OldCircuitHandler.java new file mode 100644 index 0000000000..1c023b7304 --- /dev/null +++ b/src/Java/gtPlusPlus/core/handler/OldCircuitHandler.java @@ -0,0 +1,50 @@ +package gtPlusPlus.core.handler; + +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableOldGTcircuits; + +import java.lang.reflect.Field; +import java.util.HashSet; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.EmptyRecipeMap; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; + +public class OldCircuitHandler { + + public static void preInit(){ + if (enableOldGTcircuits && CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + removeCircuitRecipeMap(); //Bye shitty recipes. + } + } + + public static void init(){ + + } + + public static void postInit(){ + + } + + private static boolean removeCircuitRecipeMap(){ + try { + Utils.LOG_INFO("[Old Feature - Circuits] Trying to override the Circuit Assembler Recipe map, so that no recipes for new circuits get added."); + ReflectionUtils.setFinalStatic(GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"), new EmptyRecipeMap(new HashSet(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false)); + Field jaffar = GT_Recipe_Map.class.getDeclaredField("sCircuitAssemblerRecipes"); + FieldUtils.removeFinalModifier(jaffar, true); + jaffar.set(null, new EmptyRecipeMap(new HashSet(0), "gt.recipe.removed", "Removed", null, GT_Values.RES_PATH_GUI + "basicmachines/Default", 0, 0, 0, 0, 0, GT_Values.E, 0, GT_Values.E, true, false)); + Utils.LOG_INFO("[Old Feature - Circuits] Successfully replaced circuit assembler recipe map with one that cannot hold recipes."); + } + catch (Exception e) { + Utils.LOG_INFO("[Old Feature - Circuits] Failed removing circuit assembler recipe map."); + return false; + } + return true; + } + +} diff --git a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java index 372527cdb2..16599b3b8b 100644 --- a/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/BlockEventHandler.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.handler.events; -import static gtPlusPlus.core.lib.CORE.configSwitches.chanceToDropDrainedShard; -import static gtPlusPlus.core.lib.CORE.configSwitches.chanceToDropFluoriteOre; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropDrainedShard; +import static gtPlusPlus.core.lib.CORE.ConfigSwitches.chanceToDropFluoriteOre; import java.util.ArrayList; import java.util.Random; diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java index eac8757b0e..1096816690 100644 --- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java @@ -39,7 +39,7 @@ public class LoginEventHandler { if (!this.localPlayerRef.worldObj.isRemote){ PlayerCache.appendParamChanges(this.localPlayersName, this.localPlayersUUID.toString()); - if (CORE.configSwitches.enableUpdateChecker){ + if (CORE.ConfigSwitches.enableUpdateChecker){ if (!Utils.isModUpToDate()){ Utils.LOG_INFO("[GT++] You're not using the latest recommended version of GT++, consider updating."); if (!CORE.MASTER_VERSION.toLowerCase().equals("offline")) { diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index c6593ea82e..bdb1837aa1 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -54,7 +54,7 @@ import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase; import gtPlusPlus.core.item.tool.staballoy.StaballoyAxe; import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; @@ -573,7 +573,7 @@ public final class ModItems { //Load Tree Farmer - if (CORE.configSwitches.enableMultiblock_TreeFarmer){ //https://en.wikipedia.org/wiki/UAN + if (CORE.ConfigSwitches.enableMultiblock_TreeFarmer){ //https://en.wikipedia.org/wiki/UAN dustFertUN18 = ItemUtils.generateSpecialUseDusts("UN18Fertiliser", "UN-18 Fertiliser", Utils.rgbtoHexValue(60, 155, 60))[0]; dustFertUN32 = ItemUtils.generateSpecialUseDusts("UN32Fertiliser", "UN-32 Fertiliser", Utils.rgbtoHexValue(55, 190, 55))[0]; @@ -645,10 +645,10 @@ public final class ModItems { } //A plate of Europium. - if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.configSwitches.enableCustom_Pipes){ + if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ itemPlateEuropium = new BaseItemPlate(MaterialUtils.generateMaterialFromGtENUM(Materials.Europium)); } - if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.configSwitches.enableCustom_Pipes){ + if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ itemDoublePlateEuropium = new BaseItemPlateDouble(MaterialUtils.generateMaterialFromGtENUM(Materials.Europium)); } @@ -801,7 +801,7 @@ public final class ModItems { //Special Item Handling Case - if (configSwitches.enableAlternativeBatteryAlloy) { + if (ConfigSwitches.enableAlternativeBatteryAlloy) { //ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); TODO ModItems.itemPlateBatteryAlloy = ItemUtils.generateSpecialUsePlate("BatteryAlloy", "Battery Alloy", new short[]{35, 228, 141}, 0); diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 80b48913d5..235d50ae36 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -59,7 +59,7 @@ public class BaseItemComponent extends Item{ } public String getCorrectTextures(){ - if (!CORE.configSwitches.useGregtechTextures){ + if (!CORE.ConfigSwitches.useGregtechTextures){ return CORE.MODID + ":" + "item"+this.componentType.COMPONENT_NAME; } if (this.componentType == ComponentTypes.GEAR){ diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java index f5fff65882..f2228afb78 100644 --- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java @@ -48,7 +48,7 @@ public class BaseItemCell extends BaseItemComponent{ @Override public void registerIcons(final IIconRegister i) { - if (CORE.configSwitches.useGregtechTextures){ + if (CORE.ConfigSwitches.useGregtechTextures){ this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell"); this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "cell_OVERLAY"); } @@ -64,10 +64,10 @@ public class BaseItemCell extends BaseItemComponent{ @Override public int getColorFromItemStack(final ItemStack stack, final int renderPass) { - if (renderPass == 0 && !CORE.configSwitches.useGregtechTextures){ + if (renderPass == 0 && !CORE.ConfigSwitches.useGregtechTextures){ return Utils.rgbtoHexValue(230, 230, 230); } - if (renderPass == 1 && CORE.configSwitches.useGregtechTextures){ + if (renderPass == 1 && CORE.ConfigSwitches.useGregtechTextures){ return Utils.rgbtoHexValue(230, 230, 230); } return this.componentColour; diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index d22e606e78..6aa1f54cc8 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -78,7 +78,7 @@ public class BaseItemDust extends Item{ } private String getCorrectTexture(final String pileSize){ - if (!CORE.configSwitches.useGregtechTextures){ + if (!CORE.ConfigSwitches.useGregtechTextures){ if ((pileSize == "dust") || (pileSize == "Dust")){ this.setTextureName(CORE.MODID + ":" + "dust");} else{ diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index 93fc833c79..f19aaff4b3 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -85,7 +85,7 @@ public class BaseItemDustUnique extends Item{ } private String getCorrectTexture(final String pileSize){ - if (!CORE.configSwitches.useGregtechTextures){ + if (!CORE.ConfigSwitches.useGregtechTextures){ if ((pileSize == "dust") || (pileSize == "Dust")){ this.setTextureName(CORE.MODID + ":" + "dust");} else{ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index cd30fdd165..b6f139b74a 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -65,7 +65,7 @@ public class BaseItemIngotHot extends BaseItemIngot{ @Override @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses(){ - if (CORE.configSwitches.useGregtechTextures){ + if (CORE.ConfigSwitches.useGregtechTextures){ return true; } else { @@ -76,7 +76,7 @@ public class BaseItemIngotHot extends BaseItemIngot{ @Override public void registerIcons(final IIconRegister i) { - if (CORE.configSwitches.useGregtechTextures){ + if (CORE.ConfigSwitches.useGregtechTextures){ this.base = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot"); this.overlay = i.registerIcon("gregtech" + ":" + "materialicons/METALLIC/" + "ingotHot_OVERLAY"); } @@ -89,10 +89,10 @@ public class BaseItemIngotHot extends BaseItemIngot{ @Override public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { - if(pass == 0 && CORE.configSwitches.useGregtechTextures) { + if(pass == 0 && CORE.ConfigSwitches.useGregtechTextures) { return this.base; } - else if(pass == 1 && CORE.configSwitches.useGregtechTextures) { + else if(pass == 1 && CORE.ConfigSwitches.useGregtechTextures) { return this.overlay; } else { diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java index 2c6479fbd4..cc73ba3d32 100644 --- a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java +++ b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java @@ -19,7 +19,7 @@ public class ItemsMultiTools { //Load Multitools final boolean gtStyleTools = LoadedMods.Gregtech; - if (CORE.configSwitches.enableMultiSizeTools){ + if (CORE.ConfigSwitches.enableMultiSizeTools){ //GT Materials final Materials[] rm = Materials.values(); diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index cd6aacd3a8..f9959f6d57 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -11,6 +11,7 @@ import java.util.concurrent.ConcurrentHashMap; import com.mojang.authlib.GameProfile; import gregtech.api.GregTech_API; +import gtPlusPlus.api.analytics.SegmentAnalytics; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.geo.GeoUtils; @@ -28,6 +29,11 @@ import net.minecraftforge.common.config.Configuration; public class CORE { + //Analytics handler + public static SegmentAnalytics mAnalytics; + + + protected CORE(){ //import cpw.mods.fml.common.Optional; } @@ -105,7 +111,7 @@ public class CORE { //public static final Materials2[] MiscGeneratedMaterials = new Materials2[1000]; - public static class configSwitches { + public static class ConfigSwitches { //Updates public static boolean enableUpdateChecker = true; diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java index dda50a0d84..632c9d235f 100644 --- a/src/Java/gtPlusPlus/core/lib/LoadedMods.java +++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.lib; import static gtPlusPlus.core.lib.CORE.GTNH; import cpw.mods.fml.common.Loader; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures; import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder; @@ -90,7 +90,7 @@ public class LoadedMods { Utils.LOG_INFO("Components enabled for: BuildCraft"); totalMods++; } - if ((Loader.isModLoaded("EnderIO") == true) && !configSwitches.disableEnderIOIntegration){ + if ((Loader.isModLoaded("EnderIO") == true) && !ConfigSwitches.disableEnderIOIntegration){ EnderIO = true; Utils.LOG_INFO("Components enabled for: EnderIO"); totalMods++; diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index 4a9584466a..448188379a 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -22,7 +22,7 @@ import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion; import gtPlusPlus.core.entity.projectile.EntityToxinballSmall; import gtPlusPlus.core.handler.render.FirepitRender; import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.lib.CORE.configSwitches; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.util.Utils; @@ -44,7 +44,7 @@ public class ClientProxy extends CommonProxy implements Runnable{ @SubscribeEvent public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) { - if (configSwitches.enableCustomCapes){ + if (ConfigSwitches.enableCustomCapes){ mCapeRenderer.receiveRenderSpecialsEvent(aEvent); } } @@ -55,7 +55,7 @@ public class ClientProxy extends CommonProxy implements Runnable{ @Override public void preInit(final FMLPreInitializationEvent e) { super.preInit(e); - if (configSwitches.enableCustomCapes){ + if (ConfigSwitches.enableCustomCapes){ onPreLoad(); } //Do this weird things for textures. @@ -153,7 +153,7 @@ public class ClientProxy extends CommonProxy implements Runnable{ public void onPreLoad() { - if (configSwitches.enableCustomCapes){ + if (ConfigSwitches.enableCustomCapes){ String arr$[] = { "draknyte1", "fobius" }; @@ -168,7 +168,7 @@ public class ClientProxy extends CommonProxy implements Runnable{ public void run() { try { - if (configSwitches.enableCustomCapes){ + if (ConfigSwitches.enableCustomCapes){ Utils.LOG_INFO("GT++ Mod: Downloading Cape List."); @SuppressWarnings("resource") Scanner tScanner = new Scanner(new URL("https://github.com/draknyte1/GTplusplus/blob/master/SupporterList.txt").openStream()); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index c74603abc1..a333af99e7 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -1060,7 +1060,7 @@ public class RECIPES_GREGTECH { private static void benderRecipes(){ - if (CORE.configSwitches.enableMultiblock_PowerSubstation){ + if (CORE.ConfigSwitches.enableMultiblock_PowerSubstation){ GT_Values.RA.addBenderRecipe(ItemUtils.getItemStackOfAmountFromOreDict("ingotVanadium", 1), ItemUtils.getItemStackOfAmountFromOreDict("plateVanadium", 1), 8, 16); } } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java index 1a9ae86c52..4f5cfd74e6 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java @@ -19,7 +19,7 @@ public class RECIPES_LaserEngraver implements IOreRecipeRegistrator { public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) { if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) { - if (CORE.configSwitches.enableCustomCircuits && !CORE.GTNH){ + if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilYttriumBariumCuprate", 1) != null){ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480); } @@ -45,7 +45,7 @@ public class RECIPES_LaserEngraver implements IOreRecipeRegistrator { } else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) { - if (CORE.configSwitches.enableCustomCircuits && !CORE.GTNH){ + if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilOsmium", 1) != null){ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]), 64, 1024); } @@ -58,7 +58,7 @@ public class RECIPES_LaserEngraver implements IOreRecipeRegistrator { } else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) { } else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) { } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) { - if (CORE.configSwitches.enableCustomCircuits && !CORE.GTNH){ + if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){ if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilNaquadah", 1) != null){ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]), 64, 2000); } diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java index c644163331..14921c645e 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java @@ -382,7 +382,7 @@ public class RECIPES_MachineComponents { } private static void GregtechMachinePhase(){ - if (CORE.configSwitches.enableCustomCircuits && !CORE.GTNH){ + if (CORE.ConfigSwitches.enableCustomCircuits && !CORE.GTNH){ Utils.LOG_INFO("Adding Gregtech machine recipes for the circuits."); GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), 32, 256); GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), 64, 512); diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 60fa118b1d..9e408ff7d4 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -214,7 +214,7 @@ public class RECIPES_Machines { } - if (CORE.configSwitches.enableMultiblock_IndustrialCokeOven){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven){ if(LoadedMods.Railcraft){ //Misc INPUT_RCCokeOvenBlock = ItemUtils.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1); @@ -367,7 +367,7 @@ public class RECIPES_Machines { RECIPE_Buffer_MAX); //Steam Condenser - if (CORE.configSwitches.enableMachine_SteamConverter ){ + if (CORE.ConfigSwitches.enableMachine_SteamConverter ){ RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1); RecipeUtils.addShapedGregtechRecipe( pipeLargeCopper, pipeHugeSteel, pipeLargeCopper, @@ -377,7 +377,7 @@ public class RECIPES_Machines { } - if (CORE.configSwitches.enableMultiblock_IronBlastFurnace){ + if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace){ RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace.get(1); RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks.get(Casing_Amount); @@ -405,7 +405,7 @@ public class RECIPES_Machines { GT_Values.RA.addArcFurnaceRecipe(RECIPE_IronPlatedBricks, new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotWroughtIron", 6), ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustAsh", 2)}, new int[]{0}, 32*20, 32); } - if (CORE.configSwitches.enableMultiblock_IndustrialCentrifuge){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialCentrifuge){ //Industrial Centrifuge RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1); RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(Casing_Amount); @@ -424,7 +424,7 @@ public class RECIPES_Machines { RECIPE_IndustrialCentrifugeCasing); } - if (CORE.configSwitches.enableMultiblock_IndustrialCokeOven){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialCokeOven){ //Industrial Coke Oven RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1); RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(Casing_Amount); @@ -467,7 +467,7 @@ public class RECIPES_Machines { RECIPE_IndustrialCokeOvenCasingB); } - if (CORE.configSwitches.enableMultiblock_IndustrialElectrolyzer){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialElectrolyzer){ //Industrial Electrolyzer RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer.get(1); RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(Casing_Amount); @@ -486,7 +486,7 @@ public class RECIPES_Machines { RECIPE_IndustrialElectrolyzerController); } - if (CORE.configSwitches.enableMultiblock_IndustrialPlatePress){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialPlatePress){ //Industrial Material Press RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1); RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(Casing_Amount); @@ -505,7 +505,7 @@ public class RECIPES_Machines { RECIPE_IndustrialMaterialPressController); } - if (CORE.configSwitches.enableMultiblock_IndustrialMacerationStack){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialMacerationStack){ //Industrial Maceration Stack RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack.get(1); RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack.get(Casing_Amount); @@ -524,7 +524,7 @@ public class RECIPES_Machines { RECIPE_IndustrialMacerationStackController); } - if (CORE.configSwitches.enableMultiblock_IndustrialWireMill){ + if (CORE.ConfigSwitches.enableMultiblock_IndustrialWireMill){ //Industrial Wire Factory RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1); RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(Casing_Amount); @@ -546,7 +546,7 @@ public class RECIPES_Machines { //Tiered Tanks - if (CORE.configSwitches.enableMachine_FluidTanks){ + if (CORE.ConfigSwitches.enableMachine_FluidTanks){ Utils.LOG_WARNING("Is New Horizons Loaded? "+CORE.GTNH); if (!CORE.GTNH){ RecipeUtils.addShapedGregtechRecipe( @@ -640,7 +640,7 @@ public class RECIPES_Machines { } } - if (CORE.configSwitches.enableMultiblock_MultiTank){ + if (CORE.ConfigSwitches.enableMultiblock_MultiTank){ //Industrial Multi Tank RECIPE_IndustrialMultiTankController = GregtechItemList.Industrial_MultiTank.get(1); RECIPE_IndustrialMultiTankFrame = GregtechItemList.Casing_MultitankExterior.get(Casing_Amount); @@ -680,7 +680,7 @@ public class RECIPES_Machines { mSemiFluidgen, Character.valueOf('G'), OrePrefixes.gearGt.get(Materials.StainlessSteel) }); - if (CORE.configSwitches.enableMultiblock_AlloyBlastSmelter){ + if (CORE.ConfigSwitches.enableMultiblock_AlloyBlastSmelter){ //Industrial Blast Smelter RECIPE_IndustrialBlastSmelterController = GregtechItemList.Industrial_AlloyBlastSmelter.get(1); RECIPE_IndustrialBlastSmelterFrame = GregtechItemList.Casing_BlastSmelter.get(Casing_Amount); @@ -706,7 +706,7 @@ public class RECIPES_Machines { RECIPE_IndustrialBlastSmelterCoil); } - if (CORE.configSwitches.enableMultiblock_MatterFabricator){ + if (CORE.ConfigSwitches.enableMultiblock_MatterFabricator){ //Industrial Matter Fabricator RECIPE_IndustrialMatterFabController = GregtechItemList.Industrial_MassFab.get(1); RECIPE_IndustrialMatterFabFrame = GregtechItemList.Casing_MatterFab.get(Casing_Amount); @@ -732,7 +732,7 @@ public class RECIPES_Machines { RECIPE_IndustrialMatterFabCoil); } - if (CORE.confi