Posted October 7, 20214 yr Using ShieldBaseModel from vanilla, I have added a copper shield with the exact same model as the vanilla item. It renders properly when holding it, but it doesn't properly go up when blocking with the shield. It's also slightly rotated when I look at the player in third person mode. I can't figure out where the mistake lies, any help would be greatly appreciated. I am modding with Forge 36.2.6 for Minecraft 1.16.5 GitRepo: https://github.com/Leronus/mOres Classes used: src/main/java/mod/mores/client/entity/model/ModelHandler.java src/main/java/mod/mores/client/entity/render/ShieldTileEntityRenderer.java src/main/java/mod/mores/client/entity/ShieldTextures.java src/main/java/mod/mores/init/ItemInit.java src/main/java/mod/mores/objects/ItemShield.java https://imgshare.io/image/pFTDBO https://imgshare.io/image/pFTtc9
October 7, 20214 yr Author 41 minutes ago, Luis_ST said: do never use @OnlyIn it's only for vanilla, did you looked at vanilla? I did, removing it doesn't solve my issue though
October 7, 20214 yr Author 30 minutes ago, Luis_ST said: that's not a answer to my question Your question was and I quote "did you looked at vanilla?" This can be interpreted in many ways, but I'm guessing that you meant "did you look at the vanilla source code for the shield?" If that is in fact what you meant, I answered with "yes I did." I believe that suffices as an answer to your question but please correct me if I'm wrong. In conclusion, I still don't see how a single annotation in a class used for saving the ResourceLocation of my shield textures impacts the way the model is rendered when blocking with the shield... Edited October 7, 20214 yr by Leronus
October 7, 20214 yr Author 1 hour ago, Luis_ST said: why do you not use an extension of the vanilla renderer? I am? ShieldTileEntityRenderer extends ItemStackTileEntityRenderer
October 7, 20214 yr 1 hour ago, Leronus said: I am? ShieldTileEntityRenderer extends ItemStackTileEntityRenderer sorry, I forgot that vanilla handle rendering of Items in one class the render code looks okay i think your blocking model is wrong
October 8, 20214 yr no, it's an error in your json models check them or use the vanilla one for testing
October 8, 20214 yr Author 6 hours ago, Luis_ST said: no, it's an error in your json models check them or use the vanilla one for testing oh shit okay thanks I'll take a look at that
October 8, 20214 yr Author 7 hours ago, Luis_ST said: no, it's an error in your json models check them or use the vanilla one for testing I have updated the json models. The blocking is now registering properly in third person mode, however when just holding the shield it is still slightly rotated. It also appears to be rendering the blocking shield permanently in first person mode. Even when not actually blocking. Any ideas what might be the cause? Edited October 8, 20214 yr by Leronus
October 8, 20214 yr your copper shield json "extends" your wood shield, inside i found this error: wood_shield, line 17, translation y should be 2 wood_shield, line 22, translation y should be -2 wood_shield_blocking, line 17, translation y should be 5 wood_shield_blocking, line 22, translation y should be 5 i'm not sure if this values cause the error but you can change them and test again
October 8, 20214 yr Author 38 minutes ago, Luis_ST said: your copper shield json "extends" your wood shield, inside i found this error: wood_shield, line 17, translation y should be 2 wood_shield, line 22, translation y should be -2 wood_shield_blocking, line 17, translation y should be 5 wood_shield_blocking, line 22, translation y should be 5 i'm not sure if this values cause the error but you can change them and test again Yeah that was my old model, I have since committed and pushed the new models, where new problems arise
October 8, 20214 yr can you post a screenshot how the shield is rendered (you can't upload files with a size over 2MB)
October 8, 20214 yr Author Copper shield - Not blocking - Third Person (does not work as intended) https://imgshare.io/image/pFofW8 Vanilla shield - Not blocking - Third Person https://imgshare.io/image/pFozKw Copper shield - Blocking - Third Person (works as intended) https://imgshare.io/image/pFoBOK Vanilla shield - Blocking - Third Person https://imgshare.io/image/pFo1FS Vanilla shield - Not blocking - First Person https://imgshare.io/image/pFogUj Copper shield - Not blocking - First Person (does not work as intended, is being rendered as "blocking") https://imgshare.io/image/pFtrH6 Copper shield - Blocking - First Person (works as intended) https://imgshare.io/image/pFtNwe Vanilla shield - Blocking - First Person https://imgshare.io/image/pFtpIy
October 8, 20214 yr after use debugger in your repo i found the error: that's your error compare this with the vanilla ItemModelProperty for the Shield it should be: Spoiler (stack, world, entity) -> entity != null && entity.isUsingItem() && entity.getUseItem() == stack ? 1.0F : 0.0F
October 8, 20214 yr Author 2 hours ago, Luis_ST said: after use debugger in your repo i found the error: that's your error compare this with the vanilla ItemModelProperty for the Shield it should be: Hide contents (stack, world, entity) -> entity != null && entity.isUsingItem() && entity.getUseItem() == stack ? 1.0F : 0.0F Bro I thought it was that statement too, back in 1.16.3 it was entity.IsHandActive(), but I couldn't find the right replacement. Apparently it's isUsingItem() as you said Thanks a lot man!
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.