Jump to content

Bind custom texture to Mob?


Xwaffle

Recommended Posts

The question is a bit ... confusing. ;)

 

Construction of a mob's models happens at most twice during the game run: Once into Minecraft's internal representation of it (during the constructor call of its Model) and once when the model first has to be rendered, into graphic card memory (in compileDisplayList(float) of its ModelRenderers). Neither of them involve any texture binding.

 

Texture binding (for mobs) happens once per frame the entity is to be rendered in renderModel(EntityLivingBase, float, float, float, float, float, float) (actually more of a renderModel(<? extends EntityLivingBase>, float, float, float, float, float, float)  in original code, but we don't get the generics decompiled properly right now) of the entity's renderer, and it typically binds whatever ResourceLocation gets returned from getEntityTexture(Entity) of the entity's renderer returns (though the Ender Dragon specifically also some extra code for the "dying" textures).

 

There are no hooks or events you can set anywhere in code to manipulate that. Your best - least invasive, at least - bet would be to do a coremod and exchange RenderDragon's protected ResourceLocation getEntityTexture(Entity) method with your own. More complicated (in terms of the amount of code needed) would be to @ForgeSubscribe to the RenderLivingEvent.Pre event and do the whole dragon rendering yourself, preventing the original renderer from even running (event.setCanceled(true)).

ItemBlock is not a Block

ItemStack is not an Item

Damage value is not metadata

 

Stop confusing them.

Link to comment
Share on other sites

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.