Posted August 29, 201411 yr 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"));
August 29, 201411 yr 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. I am the self-nominated Lord of the Mastodons and don't you dare deny it. Also, check out my YouTube channel: https://www.youtube.com/user/DerpDerp44/
August 29, 201411 yr Author 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
August 29, 201411 yr Not necessarily toFile(), just something like it. You could make a new File, and then use the .getResourcePath();, and return the new file. Otherwise, I'm not sure. I am the self-nominated Lord of the Mastodons and don't you dare deny it. Also, check out my YouTube channel: https://www.youtube.com/user/DerpDerp44/
August 30, 201411 yr 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.