From 842bb420fa07cfb0cc2fb71e44a2ea504680863a Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Mon, 18 Aug 2014 16:38:07 +0200 Subject: [PATCH] Unify config file references --- .../iguanatweakstconstruct/IguanaTweaksTConstruct.java | 5 ++--- .../restriction/IguanaPartRestriction.java | 2 +- .../restriction/RestrictionConfig.java | 5 +++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/IguanaTweaksTConstruct.java b/src/main/java/iguanaman/iguanatweakstconstruct/IguanaTweaksTConstruct.java index 9b80ad7..ed912c1 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/IguanaTweaksTConstruct.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/IguanaTweaksTConstruct.java @@ -63,7 +63,6 @@ public class IguanaTweaksTConstruct { public static List toolParts = null; - // TODO: decide wether or not the same cfg as tcon should be used // use the PulseManager. This allows us to separate the different parts into independend modules and have stuff together. yay. private IConfiguration pulseCFG; private PulseManager pulsar; @@ -77,12 +76,12 @@ public class IguanaTweaksTConstruct { configPath.mkdirs(); // init pulse manager - pulseCFG = new PulsarCFG(new File(configPath, "Modules.cfg"), "Tinker's Construct Addon: Iguana Tweaks for Tinkers Construct"); + pulseCFG = new PulsarCFG(Reference.configFile("Modules.cfg"), "Tinker's Construct Addon: Iguana Tweaks for Tinkers Construct"); pulseCFG.load(); pulsar = new PulseManager(Reference.MOD_ID, pulseCFG); Config config = new Config(); - config.init(new File(configPath, "main.cfg")); + config.init(Reference.configFile("main.cfg")); // register config as eventhandler to get config changed updates FMLCommonHandler.instance().bus().register(config); diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/restriction/IguanaPartRestriction.java b/src/main/java/iguanaman/iguanatweakstconstruct/restriction/IguanaPartRestriction.java index 01d64ec..5761a17 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/restriction/IguanaPartRestriction.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/restriction/IguanaPartRestriction.java @@ -24,7 +24,7 @@ public class IguanaPartRestriction { RestrictionHelper.init(); RestrictionConfig config = new RestrictionConfig(); - config.init(new File(IguanaTweaksTConstruct.configPath, "restrictions.cfg")); + config.init("restrictions.cfg"); adaptChestLoot(); diff --git a/src/main/java/iguanaman/iguanatweakstconstruct/restriction/RestrictionConfig.java b/src/main/java/iguanaman/iguanatweakstconstruct/restriction/RestrictionConfig.java index 9897a86..acc61b5 100644 --- a/src/main/java/iguanaman/iguanatweakstconstruct/restriction/RestrictionConfig.java +++ b/src/main/java/iguanaman/iguanatweakstconstruct/restriction/RestrictionConfig.java @@ -1,5 +1,6 @@ package iguanaman.iguanatweakstconstruct.restriction; +import iguanaman.iguanatweakstconstruct.reference.Reference; import iguanaman.iguanatweakstconstruct.util.Log; import net.minecraftforge.common.config.Configuration; import tconstruct.library.TConstructRegistry; @@ -13,8 +14,8 @@ public class RestrictionConfig { private Configuration configfile; // public static Map> restrictedParts = new HashMap>(); - public void init(File file) { - configfile = new Configuration(file); + public void init(String fileName) { + configfile = new Configuration(Reference.configFile(fileName)); configfile.load(); Log.info("Applying Tool Part restrictions");