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

Fix set equipment translation in 1.20.5->.3 and replace magic values #886

Merged
merged 3 commits into from
Sep 15, 2024

Conversation

FlorianMichael
Copy link
Member

Closes #862

@kennytv
Copy link
Member

kennytv commented Sep 15, 2024

It's not so much the min byte value that is used here as it is the last available bit (1 << 7). Same thing with max value, what's important is that it strips the last bit/only keep the bits until then, not that it's the max positive value (their hex representation doesn't show that either, but changing it to min/max value isn't better)

@FlorianMichael
Copy link
Member Author

Then we should at least use the decimal values MC also has to prevent confusion

@kennytv
Copy link
Member

kennytv commented Sep 15, 2024

It's only that in decompiled code because of proguard and constant inlining during compilation, the only representation that will show it accuratetly is 1 << 7. 0x7f is okay because the alternative would be (byte) ~ (1 << 7), and hex f with or without a tailing 7 are more obvious tellers of a number with all bits set up to a point

@FlorianMichael
Copy link
Member Author

Hm yeah, thanks for clarification

@kennytv kennytv merged commit 36baf6e into master Sep 15, 2024
2 checks passed
@kennytv kennytv deleted the fix/set-equipment-rewriting branch September 15, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phoenix Lobby Index 6 out of bounds for lenght 6
2 participants