ThexXTURBOXx / Balkons-WeaponMod-Legacy

Balkon's WeaponMod: Legacy for modern Minecraft
https://www.curseforge.com/minecraft/mc-mods/balkons-weaponmod-legacy
MIT License
5 stars 1 forks source link

1.7.10: item models for entities #16

Open ThexXTURBOXx opened 4 weeks ago

ThexXTURBOXx commented 4 weeks ago

I wanted to port this 1.8.9-option to 1.7.10, but it does not seem to be possible without writing an own item renderer (which I don't really want to do). Maybe, at some point I find some easier way?

makumaku1974 commented 4 weeks ago

Why do you need to port it... Is it not available?

ThexXTURBOXx commented 3 weeks ago

Why do you need to port it... Is it not available?

Actually, yes, sadly it is not yet available on 1.7.10. In order to achieve this effect on 1.8.9+, we use RenderItem#renderItem as seen here. This function sadly does not exist on 1.7.10 - I suspect it was added together with the migration to JSON item models. I tried quite a few things to work around this limitation. Most prominently, I created a "mock" EntityItem class and tried to trick the game into rendering that instead as seen here. However, on 1.7.10, the game expects that RenderItem#doRender is only supposed to render an item that is laying on the ground, hence it already applies quite many transformations (which completely distort the position of the entity I want to render with it). I was thinking about just applying the reverse transformations before calling that function, but it's not the nicest way... Maybe, there is something better?