Jump to content

Recommended Posts

Posted

ImageIO uses a file for the parameters, but instead I want to use something like ResourceLocation, is this possible?

ImageIO.write(combined, "PNG", new ResourceLocation("tvmod", "textures/blocks/combined.png"));

Posted

Just a question, why are you using ImageIO? Also, try looking at the methods available for ResourceLocation, like this:

ImageIO.write(combined, "PNG", new ResourceLocation("tvmod", "textures/blocks/combined.png").toFile());

Or something like that.

 

There is no toFile() method, and i'm using it to combine two images together from within java

Posted

So modding is just using Java, so you should just do file operations like you would normally.  Perhaps you can use the user home directory. 

 

In your pre-init method (the method that handles the FMLPreInitializationEvent event), the event that is passed has a field called: getSuggestedConfigurationFile()

 

You could take the path to that file and use same path for your file.  The point is that this is a place that the user already expects some Minecraft mod specific files, so it shouldn't be annoying to them if you do some other file activity there.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.