Jump to content

Recommended Posts

Posted (edited)

I'm having a strange issue where when I register two custom entities (a Deer and Baker). They are both working exactly as expected except that it uses the model and texture of the first entity, the Deer, for the second as well, the Baker. If I were doing something wrong with my Baker entity's model/texture/resource location stuff I'd expect it to just not load in or crash, but instead it loads in perfectly as my new Deer entity. 

 

Register Entity Renders

		RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new IRenderFactory<EntityDeer>() {
			@Override
			public Render<? super EntityDeer> createRenderFor(RenderManager manager){
				return new RenderDeer(manager);
			}
		});
		
		RenderingRegistry.registerEntityRenderingHandler(EntityBaker.class, new IRenderFactory<EntityBaker>() {
			@Override
			public Render<? super EntityBaker> createRenderFor(RenderManager manager){
				return new RenderNPC(RenderNPC.bakerTexture, manager);
			}
		});

 

This code is called from inside my preInit for Client Side. My RenderNPC class is essentially a clone of the RenderVillager class since I'm using the ModelVillager for it. I'm wondering if maybe I have to do things differently when registering multiple RenderingHandlers?

 

If any more code/info is needed, let me know.

 

EDIT:

I feel dumb for not trying to render it by itself without loading in the Deer. I've done so now and I've confirmed that the Baker entity doesn't render at all - its still there but invisible. I've been going over my code and all the pathing is correct, everything is lowercase, I'm not sure what to do next.

Edited by virassan
Posted

Please post your logs (preferably with GitHub Gist or PasteBin) and your code (preferably as a GitHub repository).

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

I actually just figured everything out.

There must've been an issue with loading in statics, so since I was using a static ResourceLocation to tell it which texture I wanted, it wasn't loading anything. I've changed that to now just take a String argument of the name of the NPC texture folder and file and I create the ResourceLocation when the RenderNPC constructor is called. Everything loads in perfectly now.

 

I was also having an issue with interacting and hitboxes where it existed but was a thin slice - but that's because I spaced and forgot to include a setSize() call. (I know this wasn't part of my original problem, but I thought I'd share it in case someone else happens to also have this issue)

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.