Jump to content

[1.12.2]3D items models rendering differently in different slots


jabelar

Recommended Posts

I have a weird bug in one of my mods. The mod intercepts the RenderItem methods for renderEffect() in order to configurably change the color and/or texture of enchantment glint effects. This works perfectly for vanilla items and the rendering is fine when item is in inventory, on ground, wielded by player, used as tab icon for creative tab, wielded by mob, and so forth.

 

However, there have been a couple other mods where an incompatibility has been logged as an issue. In this case, items will render in the player hotbar but not (nothing is shown) in the inventory slot. In other words, something that won't show in inventory shows when it is dragged to the hotbar. The item does not show when wielded either, but does when it is worn (it is added as a layer to the player model).

 

These items have 3d model (they are things like broomstick). So I think it is an issue with the ItemModelMesher registration or maybe the refresh of the resources. So I'm tracking that down. I'm just surprised though that it behaves differently in the hotbar slots than the other inventory slots.

 

Does anyone know why items (especially those with 3D model) would render differently in the hotbar slot than in other gui slots?

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Okay, I'm still working on debugging this. One thing I noticed that in the mod that is causing trouble, the items that don't work have model json that has parent = builtin/entity. The items that do work have model json that has parent = builtin/generated.

 

I can't find much information on the "builtin/entity" parent model. It seems to be used for blocks like chests and such, but not really that many things.

 

Anyone know more about builtin/entity? And any idea it wouldn't render in a slot or the world, but will render in the hotbar?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

24 minutes ago, jabelar said:

Oh, and if I dump the quads from the itemmesher for the non working items they don't have anything, but in the working items they have a bunch of quads. So it seems I'm onto something. Gotta figure out why these entity parented ones end up with no quads in the mesher...

It has to do with the TileEntityItemStackRenderer implementation.

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

It's weird because my mod basically copies the RenderItem code into my own extended class and calls exactly the same logic with the exception of changing the enchantment glint textures/color. I call the TESR rendering stuff exactly the same way.

 

I suspect the problem has to do with the other mod's Render classes referencing a RenderManager that references an entity map that that maybe I have overwritten or something. Basically, I'm injecting (through Reflection) my own RenderItem, but like many things in Minecraft the use of the vanilla RenderItem isn't very clean -- instead of always grabbing it from the Minecraft class, a lot of classes make their local own copy/reference to it. So I need to go through a bunch of classes to make sure they all get converted.

 

Anyway, looks like I've got some serious debugging to do... 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.