Hey there, I have 2 problems currently I cannot find any answer for them.
1.) Register Entity Throwable Renderer
I moslty have a problem with this line:
RenderingRegistry.registerEntityRenderingHandler(Entity.class, new Render(*.getRenderManager(), item, *.getRenderItem()));
This function is now deprecated, but there doesn't seem to be an alternate Factory version for it. Can anyone give me an example of how to do it, or how to translate Minecraft..getMinecraft.getRenderItem() to the new factory system?
2.) I have 2 throwing items, Nuggets and Dynamite, the nugget works quite nicely, but the dynamite always renders with the nugget texture. I'm not even sure what I did wrong here. So if anyone has the spare time to look over my code it would be much appriciated.
Hey there, I have 2 problems currently I cannot find any answer for them.
1.) Register Entity Throwable Renderer
I moslty have a problem with this line:
RenderingRegistry.registerEntityRenderingHandler(Entity.class, new Render(*.getRenderManager(), item, *.getRenderItem()));
This function is now deprecated, but there doesn't seem to be an alternate Factory version for it. Can anyone give me an example of how to do it, or how to translate Minecraft..getMinecraft.getRenderItem() to the new factory system?
Use RenderingRegistry#registerEntityRenderingHandler(Class, IRenderFactory). Your IRenderFactory implementation should create the Render instance with the provided RenderManager argument.
If you're targeting Java 8, you can use a lambda or constructor method reference to implement IRenderFactory. If you're targeting Java 6/7, you can use an anonymous class.
2.) I have 2 throwing items, Nuggets and Dynamite, the nugget works quite nicely, but the dynamite always renders with the nugget texture. I'm not even sure what I did wrong here. So if anyone has the spare time to look over my code it would be much appriciated. https://gist.github.com/Epidra/acf7c589de8488d2763352342a29e018
I'm not sure what the issue is, but I'd recommend using RenderSnowball directly instead of copy-pasting it into your own classes.
Don't use unlocalised names for anything except translation/display, they're not unique and can change at any time. Use registry names if you need a unique name.
Edit: The post editor really doesn't like less than/greater than symbols. I can't seem to use fonts, so I've used bold where I'd normally use Courier New.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I found my mistake. Stupid me forgot to set unique IDs for the Entity Register, so whatever got registered first overwrote the Renderer for all other Entities.
On another note, could you tell me what TrackingRange, UpdateFrequenzy and SendsVelocityUpdates exactly mean how I can find the best value for my stuff?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hey there, I have 2 problems currently I cannot find any answer for them.
1.) Register Entity Throwable Renderer
I moslty have a problem with this line:
RenderingRegistry.registerEntityRenderingHandler(Entity.class, new Render(*.getRenderManager(), item, *.getRenderItem()));
This function is now deprecated, but there doesn't seem to be an alternate Factory version for it. Can anyone give me an example of how to do it, or how to translate Minecraft..getMinecraft.getRenderItem() to the new factory system?
2.) I have 2 throwing items, Nuggets and Dynamite, the nugget works quite nicely, but the dynamite always renders with the nugget texture. I'm not even sure what I did wrong here. So if anyone has the spare time to look over my code it would be much appriciated.
https://gist.github.com/Epidra/acf7c589de8488d2763352342a29e018
Use RenderingRegistry#registerEntityRenderingHandler(Class, IRenderFactory). Your IRenderFactory implementation should create the Render instance with the provided RenderManager argument.
If you're targeting Java 8, you can use a lambda or constructor method reference to implement IRenderFactory. If you're targeting Java 6/7, you can use an anonymous class.
I'm not sure what the issue is, but I'd recommend using RenderSnowball directly instead of copy-pasting it into your own classes.
Don't use unlocalised names for anything except translation/display, they're not unique and can change at any time. Use registry names if you need a unique name.
Edit: The post editor really doesn't like less than/greater than symbols. I can't seem to use fonts, so I've used bold where I'd normally use Courier New.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I found my mistake. Stupid me forgot to set unique IDs for the Entity Register, so whatever got registered first overwrote the Renderer for all other Entities.
On another note, could you tell me what TrackingRange, UpdateFrequenzy and SendsVelocityUpdates exactly mean how I can find the best value for my stuff?
Read the doc comment of EntityRegistry.registerModEntity.
Look at EntityTracker#trackEntity to see the values used for vanilla entities and use the values from the entity closest to your own.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.