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

Ask for player's groups off the main thread. #6192

Merged
merged 4 commits into from
Feb 17, 2024

Conversation

Moderocky
Copy link
Member

Description

Updates the matched vault version to 1.7.3.

LuckPerms is a little overzealous and prints a giant error when requesting groups on the main thread using the vault hook.
Since player's group[s] is an expression Skript doesn't have the option of waiting for it to resolve on a background thread.

My solution was to do the call in a completable future and block while waiting for it to resolve, so it effectively does the same thing as before without triggering the error.
Obviously this isn't ideal, but it seemed better than trying to disable the LuckPerms check specifically while the server was running.


Target Minecraft Versions: any
Requirements: none
Related Issues: #5692

This version should support 1.13 to 1.17+ according to the Spigot page. I'm not sure what this actually adds but it's usually a good idea to keep dependencies updated and all 1.7.X versions of Vault are supposed to be compatible. :)
This change is (basically) pointless -- we still block the main thread while we wait since we absolutely need to, but it prevents the errors from overzealous permissions plugins.
@Pikachu920
Copy link
Member

Pikachu920 commented Nov 19, 2023

actually, would this cause potential new issues with other permission plugins that may expect/require the API to be called from the main thread?

@Moderocky
Copy link
Member Author

actually, would this cause potential new issues with other permission plugins that may expect/require the API to be called from the main thread?

No idea, I'm fairly sure PermissionsEx is old enough that it doesn't care but I don't know about any other permissions plugins (if there are any) -- the only report we've had is LuckPerms so we could do it on a different thread iff LuckPerms is present but then that wouldn't fix it if anything else had the same requirement (or if our check didn't catch everything)

@AyhamAl-Ali AyhamAl-Ali added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Nov 20, 2023
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work Kenzie ⚡ Let's hope it doesn't break other permission plugins

@Moderocky
Copy link
Member Author

If somebody knows what permissions plugins are used currently they could test this.

@sovdeeth sovdeeth added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Nov 26, 2023
@sovdeeth sovdeeth added the 2.8 Targeting a 2.8.X version release label Jan 6, 2024
@sovdeeth sovdeeth merged commit 817b5a9 into SkriptLang:dev/patch Feb 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.8 Targeting a 2.8.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants