Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.18.2] Right click to open other player's backpack fails with non standard model size [w/ Pehkui] #892

Open
Rhyssia opened this issue Nov 4, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Rhyssia
Copy link

Rhyssia commented Nov 4, 2023

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:

  1. Set Player 2's scale with Pehkui. (/set scale pehkui:height 0.5 [and] /set scale pehkui:width 0.5 )
  2. Attempt to open their backpack by furiously right clicking their back.
  3. Frustrated, reset Player 2's scale to default. (1.0 height and width)
  4. 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

@Rhyssia Rhyssia changed the title Right click to open other player's backpack and non standard model size [w/ Pehkui] Right click to open other player's backpack fails with non standard model size [w/ Pehkui] Nov 4, 2023
@Rhyssia Rhyssia changed the title Right click to open other player's backpack fails with non standard model size [w/ Pehkui] [1.18.2] Right click to open other player's backpack fails with non standard model size [w/ Pehkui] Nov 5, 2023
@Rhyssia
Copy link
Author

Rhyssia commented Nov 6, 2023

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?

@P3pp3rF1y
Copy link
Owner

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.

@P3pp3rF1y P3pp3rF1y added the enhancement New feature or request label Nov 9, 2023
@Rhyssia
Copy link
Author

Rhyssia commented Nov 11, 2023

Thank you for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants