Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Config file in wrong spot?


Recommended Posts

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.


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().

Link to comment
Share on other sites

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.


public void preInit(FMLPreInitializationEvent event)
    configFile = event.getSuggestedConfigurationFile();



Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • and what is called OreFeatureConfig, while making ore gen
    • I have been trying to download Forge but the Windows Installer isn't coming up, I can see the installer one would use for Linux but no Windows, I have downloaded Java and Jarfix but nothing is working, can someone help?  
    • So I thought that when a capability is attached to an item/entity/etc... the capability will stay until whatever it's attached to is gone. But this doesn't seem to be the case, as when I printed to console whenever a capability is attached, it seems as though a new version of the capability is attached to an item every time I select it in my hotbar, hover over it in inventory, etc. Is this how it's supposed to work? If so, why?
    • Hi, I'm trying to set up a simple forge server just to play with a couple of my friends, but no matter what I do or try I cannot seem to get a Mods folder and for the actual forge part of the server to actually launch. Every time I try to launch the forge.jar via a .bat file I just get a bunch of errors [Errors below] I'm not sure what I'm doing wrong. If I can get some help that would be awesome, thanks C:\Users\User\Desktop\Server>java -Xms2G -Xmx6G -jar forge-1.12.2- nogui A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.base/java.lang.reflect.Method.invoke(Method.java:567)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:70)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34) Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')         at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)         at net.minecraft.launchwrapper.Launch.main(Launch.java:28)         ... 6 more C:\Users\User\Desktop\Server>pause Press any key to continue . . .  
  • Topics

  • Who's Online (See full list)

  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.