Posted July 27, 201510 yr Is there something I can call inside code to return the default minecraft pathname ? I need to save some subfolders and files subfolders and I want to be able to easily get to the /Mods/<ModName> directory. What is good practice Mod practice if you have to do this ? (e.g. create the base directory for and save files for the mod would be Mods/<Modname> ? I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr My utility: public static File getMcDir() { if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer()) { return new File("."); } return Minecraft.getMinecraft().mcDataDir; } Note: Returns /.minecraft/ for client and /server_folder/ for dedic. 1.7.10 is no longer supported by forge, you are on your own.
July 27, 201510 yr Author My utility: public static File getMcDir() { if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDedicatedServer()) { return new File("."); } return Minecraft.getMinecraft().mcDataDir; } Note: Returns /.minecraft/ for client and /server_folder/ for dedic. Just what the doctor ordered ! I'll add that to my generic utililty stuff.... I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author I'm also assuming (dangerous I know) that I use the /Mods directory and make a sub directory of that with my mod name as a place to hold my needed folders. If this is wrong, please let me know I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author If I don't use a subfolder off of the Mod folder where do I put the default folder for the mod ? I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author Its a place where I put files that my mod generates (which can have a few subfolders if neccesary). I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author My mod generates data that needs to be saved so it can be recalled later (structures etc), so basically user generated text files and potential subfolders with those files in it..... So, to restate clearer: Where do you put user generated files (generated by the mod) so that they don't clobber something else ? It would seem to make sense to put is as a subdirectory to your mod where ever you place your mod files, but , if not there, then where is the best place to put these (as a named subdirectory off the root would seem kind of inappropriate) ? I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr This is like REALLY mod-specific question. You can put data anywhere you want. I personally do it in /.minecraft/MyModFoler/myData.something Diesieben just said that your /mods/ should not contain anything other than mods. 1.7.10 is no longer supported by forge, you are on your own.
July 27, 201510 yr Author So I'll put it in a folder of my own creation of the root.... I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author Can you please clarify ? I don't see a "world" folder under my minecraft (I am running a few mods now).... If you mean by a save file, then it is not specific to that particular world per se but used by the mod to generate stuff..... I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
July 27, 201510 yr Author Then this thread is truly resolved then I hope it is of use to any future modders...... I don't keep an open mind lest someone try to fill it with garbage - Mark Twain
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.