Jump to content

Recommended Posts

Posted

I'd like to read some arbitrary files related to my mod. Specifically, these will be images and JSON config files. (I'm aware of the Forge config file format, but it's not suitable for my use case. So JSON it is.)

 

These will not be save-specific files. I.e. they should be global to the Minecraft installation. So I'm thinking they would go somewhere in minecraft/config/NameOfMyMod.

 

First, is this OK? Second, is there an API method I can call which will return the path to my mod's config folder? Once I have that path, I'll be able to read and parse the JSON data.

 

Third, will it be possible use images in the config folder as textures? If not, is there any way to achieve something similar? Essentially, I want my mod to be able to use user-supplied textures. I'd rather not force users to open the .jar file and put them there.

 

If necessary, I'd be willing to read the image data from the files myself, and pass that image data to an API method.

 

I'm targeting MC 1.5.2.

Posted

Config files are already doing this, so yes it is OK.

Loader#getConfigDir();

 

As for images/textures. Resource packs are now a built-in feature of Minecraft. That means users don't have to open your jar. They only need to make a resource pack following your jar structure and add whatever textures they want to change.

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

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

Announcements



×
×
  • Create New...

Important Information

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