Posted September 14, 201510 yr How can i get the folder that minecraft is running from so in single where the profile is save and on a sever the folder the sever is.
September 14, 201510 yr public static File getMcDir() { if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer()) { return new File("."); } return Minecraft.getMinecraft().mcDataDir; } I think it's about 5th time I'm pasting this utility here Edit: According to revelation below this post - code above should be "proxified". 1.7.10 is no longer supported by forge, you are on your own.
September 14, 201510 yr Looking at it now - IT SHOULD, but why it doesn't? (Also: how the hell I didn't notice that before). Just to support this claim: (Yes, this is dedicated server) public class IOUtils { public static File getMcDir() { System.out.println("Guess what?"); if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer()) { return new File("."); } return Minecraft.getMinecraft().mcDataDir; } } [16:44:55] [server thread/INFO] [sTDOUT]: [x.common.utils.IOUtils:getMcDir:21]: Guess what? [16:44:55] [server thread/INFO] [sTDOUT]: [x.common.utils.IOUtils:getMcDir:21]: Guess what? EDIT: Oh, the MYSTERY! I can almost hear brainz humming. 1.7.10 is no longer supported by forge, you are on your own.
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.