diff --git a/build.properties b/build.properties index 9abbffbe..4f27045e 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft_version=1.7.10 minecraft_version_old=1.7.2 forge_version=10.13.0.1151 -mantle_version=152.e3820d9 +mantle_version=155.504b639 FMP_version=1.1.0.268 CCLIB_version=1.1.0.77 NEI_version=1.0.1 diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 4eeb1f8a..755b7854 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -80,7 +80,7 @@ public class TConstruct public static TProxyCommon proxy; /* Loads modules in a way that doesn't clutter the @Mod list */ - private PulseManager pulsar = new PulseManager(modID); //Scheduled to change shortly. + private PulseManager pulsar = new PulseManager(modID, "TinkersModules"); //Scheduled to change shortly. public TConstruct() { @@ -102,21 +102,13 @@ public class TConstruct { PHConstruct.initProps(event.getModConfigurationDirectory()); - //Temporarily hijacked - if (PHConstruct.worldModule) - pulsar.registerPulse(new TinkerWorld()); - if (PHConstruct.toolModule) - pulsar.registerPulse(new TinkerTools()); - if (PHConstruct.smelteryModule) - pulsar.registerPulse(new TinkerSmeltery()); - if (PHConstruct.mechworksModule) - pulsar.registerPulse(new TinkerMechworks()); - if (PHConstruct.armorModule) - pulsar.registerPulse(new TinkerArmor()); - /*if (PHConstruct.prayerModule) - pulsar.registerPulse(new TinkerPrayers()); - if (PHConstruct.cropifyModule) - pulsar.registerPulse(new TinkerCropify());*/ + pulsar.registerPulse(new TinkerWorld()); + pulsar.registerPulse(new TinkerTools()); + pulsar.registerPulse(new TinkerSmeltery()); + pulsar.registerPulse(new TinkerMechworks()); + pulsar.registerPulse(new TinkerArmor()); + /*pulsar.registerPulse(new TinkerPrayers()); + pulsar.registerPulse(new TinkerCropify());*/ TConstructRegistry.materialTab = new TabTools("TConstructMaterials"); TConstructRegistry.toolTab = new TabTools("TConstructTools"); diff --git a/src/main/java/tconstruct/armor/TinkerArmor.java b/src/main/java/tconstruct/armor/TinkerArmor.java index ca7920b6..0c6fca15 100644 --- a/src/main/java/tconstruct/armor/TinkerArmor.java +++ b/src/main/java/tconstruct/armor/TinkerArmor.java @@ -42,7 +42,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(TConstruct.modID) -@Pulse(id = TConstruct.modID) +@Pulse(id = "TinkerArmor", description = "Modifyable armors, such as the traveller's gear.") public class TinkerArmor implements IPulse //TODO: Remove IPulse implementation, keep annotation { @Instance("TinkerArmor") diff --git a/src/main/java/tconstruct/mechworks/TinkerMechworks.java b/src/main/java/tconstruct/mechworks/TinkerMechworks.java index 41dfeb22..176c114b 100644 --- a/src/main/java/tconstruct/mechworks/TinkerMechworks.java +++ b/src/main/java/tconstruct/mechworks/TinkerMechworks.java @@ -27,7 +27,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(TConstruct.modID) -@Pulse(id = TConstruct.modID) +//TODO handle migration of all items/blocks that were owned by the previously seperate mod +@Pulse(id = "TinkerMechworks", description = "Mechanical machinations and steampunk inspired shenanigans.") public class TinkerMechworks implements IPulse //TODO: Remove IPulse implementation, keep annotation { @PulseProxy(client = "tconstruct.mechworks.MechworksProxyClient", server = "tconstruct.mechworks.MechworksProxyCommon") diff --git a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java index f3c81420..5b0f413a 100644 --- a/src/main/java/tconstruct/smeltery/TinkerSmeltery.java +++ b/src/main/java/tconstruct/smeltery/TinkerSmeltery.java @@ -86,7 +86,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(TConstruct.modID) -@Pulse(id = TConstruct.modID) +@Pulse(id = "TinkerSmeltery", description = "Liquid metals, casting, and the multiblock structure.") public class TinkerSmeltery implements IPulse //TODO: Remove IPulse implementation, keep annotation { @Instance("TinkerSmeltery") diff --git a/src/main/java/tconstruct/tools/TinkerTools.java b/src/main/java/tconstruct/tools/TinkerTools.java index 8637a9f4..5488c011 100644 --- a/src/main/java/tconstruct/tools/TinkerTools.java +++ b/src/main/java/tconstruct/tools/TinkerTools.java @@ -120,7 +120,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(TConstruct.modID) -@Pulse(id = TConstruct.modID) +@Pulse(id = "TinkerTools", description = "The main core of the mod! All of the tools, the tables, and the patterns are here.") public class TinkerTools implements IPulse //TODO: Remove IPulse implementation, keep annotation { /* Proxies for sides, used for graphics processing */ diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index 568b9ab2..7eb7f619 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -15,48 +15,20 @@ public class PHConstruct public static void initProps (File location) { - /* Before we do anything, let's set up which modules can and cannot load. */ - File modules = new File(location + "/TinkersModules.txt"); - - /* Some basic debugging will go a long way */ + File currentConfig = new File(location + "/TConstruct.cfg"); + File legacyConfig = new File(location + "/TinkersWorkshop.txt"); try { - modules.createNewFile(); + if(!currentConfig.exists() && legacyConfig.exists()) + legacyConfig.renameTo(currentConfig); } - catch (IOException e) + catch (Exception e) { - TConstruct.logger.warn("Could not create module configuration file for TConstruct. Reason:"); - TConstruct.logger.warn(e.getLocalizedMessage()); - } - /* [Forge] Configuration class, used as config method */ - Configuration config = new Configuration(modules); - config.load(); - worldModule = config.get("Modules: Disabling these will disable a chunk of the mod", "World", true, "Ores, slime islands, essence berries, and the like.").getBoolean(true); - toolModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Tools", true, "The main core of the mod! All of the tools, the tables, and the patterns are here.").getBoolean(true); - smelteryModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Smeltery", true, "Liquid metals, casting, and the multiblock structure.").getBoolean(true); - mechworksModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Smeltery", true, "Mechanical machinations and steampunk inspired shenanigans.").getBoolean(true); - armorModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Armor", true, "Modifyable armors, such as the traveller's gear.").getBoolean(true); - prayerModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Prayers", true, "Area of effect and time delayed status changes. Scrolltastic!").getBoolean(true); - cropifyModule = config.get("Modules: Disabling these will disable a chunk of the mod", "Cropify", true, "Tinkering with the world never felt this bushy.").getBoolean(true); - config.save(); - - /* Here we will set up the config file for the mod - * First: Create a folder inside the config folder - * Second: Create the actual config file - * Note: Configs are a pain, but absolutely necessary for every mod. - */ - File newFile = new File(location + "/TinkersWorkshop.txt"); - try - { - newFile.createNewFile(); - } - catch (IOException e) - { - TConstruct.logger.warn("Could not create configuration file for TConstruct. Reason:"); + TConstruct.logger.warn("Could not update legacy configuration file for TConstruct. Reason:"); TConstruct.logger.warn(e.getLocalizedMessage()); } - config = new Configuration(newFile); + Configuration config = new Configuration(currentConfig); cfglocation = location; /* Load the configuration file */ config.load(); @@ -206,12 +178,9 @@ public class PHConstruct newSmeltery = config.get("Experimental", "Use new adaptive Smeltery code", false, "Warning: Very buggy").getBoolean(false); meltableHorses = config.get("Experimental", "Allow horses to be melted down for glue", true).getBoolean(true); - // Addon stuff - isCleaverTwoHanded = config.get("Battlegear", "Can Cleavers have shields", true).getBoolean(true); - isHatchetWeapon = config.get("Battlegear", "Are Hatches also weapons", true).getBoolean(true); - - /* Save the configuration file */ - config.save(); + /* Save the configuration file only if it has changed */ + if(config.hasChanged()) + config.save(); File gt = new File(location + "/GregTech"); if (gt.exists()) @@ -222,15 +191,6 @@ public class PHConstruct gregtech = gtConfig.get("smelting", "tile.anvil.slightlyDamaged", false).getBoolean(false); } } - - //Modules - public static boolean worldModule; - public static boolean toolModule; - public static boolean smelteryModule; - public static boolean mechworksModule; - public static boolean armorModule; - public static boolean prayerModule; - public static boolean cropifyModule; public static boolean exoCraftingEnabled; public static boolean capesEnabled; @@ -373,7 +333,4 @@ public class PHConstruct public static boolean newSmeltery; public static boolean meltableHorses; - // Addon stuff - public static boolean isCleaverTwoHanded; - public static boolean isHatchetWeapon; } diff --git a/src/main/java/tconstruct/world/TinkerWorld.java b/src/main/java/tconstruct/world/TinkerWorld.java index ca41b529..089e72e9 100644 --- a/src/main/java/tconstruct/world/TinkerWorld.java +++ b/src/main/java/tconstruct/world/TinkerWorld.java @@ -90,7 +90,7 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; @ObjectHolder(TConstruct.modID) -@Pulse(id = TConstruct.modID) +@Pulse(id = "TinkerWorld", description = "Ores, slime islands, essence berries, and the like.") public class TinkerWorld implements IPulse //TODO: Remove IPulse implementation, keep annotation { @Instance("TinkerWorld")