Thread:LOTRMod/@comment-26553378-20170930183410

Hey, just got a bunch of random questions related to coding (at present 2) so here they are:

1.

submods - essentially, what can I do with one, and how do I make it. Simply defering me to a tutorial you might know of would be nice, although getting information directly from you on what I could do with a submod of the LotR mod would be nice.

2.

How to make item overlays? I've been looking into it other places, but still haven't managed to figure it out.

public void registerIcons(IconRegister iconRegister)

{

File path = new File("mymod:"); // base path of the images

// load source images

BufferedImage core = ImageIO.read(new File(path, "cores/CoreOak.png"));

BufferedImage cap = ImageIO.read(new File(path, "caps/CapGold.png"));

BufferedImage gem = ImageIO.read(new File(path, "overlay2.png"));

// create the new image, canvas size is the max. of both image sizes

int w = Math.max(core.getWidth, cap.getWidth);

w = Math.max(w, gem.getWidth);

int h = Math.max(core.getHeight, cap.getHeight);

h = Math.max(h, gem.getHeight);

BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

// paint both images, preserving the alpha channels

Graphics g = combined.getGraphics;

g.drawImage(core, 0, 0, null);

g.drawImage(cap, 0, 0, null);

g.drawImage(gem, 0, 0, null);

// Save as new image

ImageIO.write(combined, "PNG", new File(path, "wand/combined.png"));

this.itemIcon = iconRegister.registerIcon(texturePath + "combined");

}

that's my code which should create an image with a core overlayed by a cap overlayed by a gem (for a wand). However on the final ImageIO.write method, and initial ImageIO.read methods there is the following error: "Unhandled exception type IOException" I was wondering how I should go about fixing that, or if there is a different way that one is supposed to make item overlays in minecraft. 