Jump to content

Recommended Posts

Posted

Hello, I have a problem with icon registration using TextureStitchEvent.Post event.

When I try to load any texture this is what I get:

TextureAtlasSprite{name='testmod:ItemTest', frameCount=0, rotated=false, x=0, y=0, height=0, width=0, u0=0.0, u1=0.0, v0=0.0, v1=0.0}

 

Texture is located in:

assets/testmod/textures/items/ItemTest.png

 

When I try to load this texture using a registerIcons in Item class it works perfectly.

 

I am using:

Minecraft 1.7.10

Forge 10.13.2.1291

 

TextureStitchEventHandler class with @SubscribeEvent

public class TextureStitchEventHandler {

public static IIcon IconTest;

@SubscribeEvent
public void registerIcons(TextureStitchEvent.Post event) {
	TextureMap map = event.map;

	if(map.getTextureType() == 1) {
		IconTest = map.registerIcon(getTexturePath("ItemTest"));
	}
}

private String getTexturePath(String fileName) {
	return References.ModId.toLowerCase() + ":" + fileName;
}

}

 

TextureStitchEventHandler registration in ClientProxy

public class ClientProxy extends CommonProxy {

@Override
public void Init() {
	MinecraftForge.EVENT_BUS.register(new TextureStitchEventHandler());
}

}

 

Thanks for any help! :)

Posted

    /**
     * This event is fired once the texture map has loaded all textures and 
     * stitched them together. All Icons should have there locations defined
     * by the time this is fired.
     */

 

Try using TextureStitchEvent.Pre

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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