[1.18.2] Right click to open other player's backpack fails with non standard model size [w/ Pehkui]
Rhyssia opened this issue ยท 3 comments
Describe the bug
Impossible to open another player's backpack when using Pehkui mod and player model size is smaller than ~0.6 (height+width) Threshold seems to be about 0.575 of normal scale. Increasing the players hitbox size to double when the player's scale is set to 0.5 it seems that right clicking at the normal level of the backpack ( in this case a little above back of the player's head ) opens their backpack gui like expected.
To Reproduce
Steps to reproduce the behavior:
- Set Player 2's scale with Pehkui. (/set scale pehkui:height 0.5 [and] /set scale pehkui:width 0.5 )
- Attempt to open their backpack by furiously right clicking their back.
- Frustrated, reset Player 2's scale to default. (1.0 height and width)
- Backpack opens again as expected.
Expected behavior
Right clicking in the general area of another player's backpack opens the backpack when both the player and server have the option available.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions
Minecraft - 1.18.2
Forge - 4.2.10
sophisticatedbackpacks-1.18.2-3.18.60.906.jar
Pehkui-3.7.8+1.18.2-forge.jar
Think issue may be related to how the function works, specifically:
boolean isPointingAtBody = hitVector.y >= 0.9D && hitVector.y < 1.6D;
So regardless of player scale it will always open the backpack when attempting to right click the player between these block heights.
Pehkui does pass a global variable for getScale that might be usable?
I am definitely not going to add integration for Pekhui, but I can work with the size of player to aim at the backpack instead so provided that Pekhui properly updates this it should work correctly.