Leronus Posted October 7, 2021 Posted October 7, 2021 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 Quote
Luis_ST Posted October 7, 2021 Posted October 7, 2021 do never use @OnlyIn it's only for vanilla, did you looked at vanilla? 1 Quote
Leronus Posted October 7, 2021 Author Posted October 7, 2021 On 10/7/2021 at 1:13 PM, Luis_ST said: do never use @OnlyIn it's only for vanilla, did you looked at vanilla? Expand I did, removing it doesn't solve my issue though Quote
Leronus Posted October 7, 2021 Author Posted October 7, 2021 (edited) On 10/7/2021 at 1:57 PM, Luis_ST said: that's not a answer to my question Expand 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, 2021 by Leronus Quote
Luis_ST Posted October 7, 2021 Posted October 7, 2021 why do you not use an extension of the vanilla renderer? 1 Quote
Leronus Posted October 7, 2021 Author Posted October 7, 2021 On 10/7/2021 at 3:48 PM, Luis_ST said: why do you not use an extension of the vanilla renderer? Expand I am? ShieldTileEntityRenderer extends ItemStackTileEntityRenderer Quote
Luis_ST Posted October 7, 2021 Posted October 7, 2021 On 10/7/2021 at 4:49 PM, Leronus said: I am? ShieldTileEntityRenderer extends ItemStackTileEntityRenderer Expand sorry, I forgot that vanilla handle rendering of Items in one class the render code looks okay i think your blocking model is wrong Quote
Leronus Posted October 7, 2021 Author Posted October 7, 2021 Yeah it must be something in my ModelHandler.java but I'm not sure what Quote
Luis_ST Posted October 8, 2021 Posted October 8, 2021 no, it's an error in your json models check them or use the vanilla one for testing 1 Quote
Leronus Posted October 8, 2021 Author Posted October 8, 2021 On 10/8/2021 at 4:24 AM, Luis_ST said: no, it's an error in your json models check them or use the vanilla one for testing Expand oh shit okay thanks I'll take a look at that Quote
Leronus Posted October 8, 2021 Author Posted October 8, 2021 (edited) On 10/8/2021 at 4:24 AM, Luis_ST said: no, it's an error in your json models check them or use the vanilla one for testing Expand 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, 2021 by Leronus Quote
Luis_ST Posted October 8, 2021 Posted October 8, 2021 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 1 Quote
Leronus Posted October 8, 2021 Author Posted October 8, 2021 On 10/8/2021 at 1:00 PM, 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 Expand Yeah that was my old model, I have since committed and pushed the new models, where new problems arise Quote
Luis_ST Posted October 8, 2021 Posted October 8, 2021 can you post a screenshot how the shield is rendered (you can't upload files with a size over 2MB) Quote
Leronus Posted October 8, 2021 Author Posted October 8, 2021 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 Quote
Luis_ST Posted October 8, 2021 Posted October 8, 2021 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: Reveal hidden contents (stack, world, entity) -> entity != null && entity.isUsingItem() && entity.getUseItem() == stack ? 1.0F : 0.0F 1 Quote
Leronus Posted October 8, 2021 Author Posted October 8, 2021 On 10/8/2021 at 3:45 PM, 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: Reveal hidden contents (stack, world, entity) -> entity != null && entity.isUsingItem() && entity.getUseItem() == stack ? 1.0F : 0.0F Expand 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! Quote
Recommended Posts
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.