Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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

  • 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 by Leronus

  • Author
1 hour ago, Luis_ST said:

why do you not use an extension of the vanilla renderer?

I am? ShieldTileEntityRenderer extends ItemStackTileEntityRenderer

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

  • 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

  • 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 by Leronus

your copper shield json "extends" your wood shield, inside i found this error:

  1. wood_shield, line 17, translation y should be 2
  2. wood_shield, line 22, translation y should be -2
  3. wood_shield_blocking, line 17, translation y should be 5
  4. 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

  • Author
38 minutes ago, Luis_ST said:

your copper shield json "extends" your wood shield, inside i found this error:

  1. wood_shield, line 17, translation y should be 2
  2. wood_shield, line 22, translation y should be -2
  3. wood_shield_blocking, line 17, translation y should be 5
  4. 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

  • 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

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

 

  • 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.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.