Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

Change to this:

static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg")));

Change to this:

static Configuration config = new Configuration((new File(Minecraft.getMinecraftDir(), "config/EUIndustry/SteamPower.cfg")));

that doesn't work server side

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

 

 

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

  • 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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.