Posted August 24, 201213 yr This is not a big deal but all the mods i have keep dumping there config file onto my desktop. For most this wouldn't be an issue but my desktop get randomly cleaned after I've piled too much files, folder and links on it. For some reason though a few mods actual end up in the right config file and I've figured out why. Before anyone says i've not tested much i've tested on 4 pcs with all the same effect This code will cause the config file too end up in the wrong spot, or rather where ever the program that launches minecraft is at that time. For example the .bat file i use for error testing is on my desktop. Moving the .bat file around does cause a new config file to generate. Same for my minecraft.exe launcher. static Configuration config = new Configuration((new File("config/EUIndustry/SteamPower.cfg"))); this will end up in the config folder in .minecraft directory. static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg"))); The issue is this only works Client side and since mods are both client and server this can cause issues. Mainly since Minecraft.getMinecraftDir() from off the top of my head doesn't excist server side. So what i'm asking what can i do to make sure the configs for my mods ends up in the right spot without using Minecraft.getMinecraftDir(). http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
August 24, 201213 yr cpw.mods.fml.common.Loader.instance().getConfigDir() I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
August 25, 201213 yr Change to this: static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg")));
August 25, 201213 yr Change to this: static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg"))); that doesn't work server side
August 25, 201213 yr Here is what I'm using, it places a modname.cfg into the config folder. with a bit of string manipulation you can add "/EUIndustry/" and change the file name if you wish. @PreInit public void preInit(FMLPreInitializationEvent event) { configFile = event.getSuggestedConfigurationFile();
August 26, 201213 yr Author cpw.mods.fml.common.Loader.instance().getConfigDir() thanks lex i'll try that Edit: works like a charm. Just hope other mod makers see this and fix their config files. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
August 27, 201213 yr I would suggest using the preinit event method. It will *always* be right and canonical too.. the desktop thing is likely a bad launcher not injecting a folder path correctly...
August 27, 201213 yr Author I would suggest using the preinit event method. It will *always* be right and canonical too.. the desktop thing is likely a bad launcher not injecting a folder path correctly... could be i guess i might need to update my .bat files so they link the path names right. Still a bit odd though seeing as this never happened before 1.3 update. Then again in 1.2.5 people had minecraft.getDir() in the client side of their mod. http://i577.photobucket.com/albums/ss215/bobstrong/ModBannerMed.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.