Add possibility to be hidden from jobs tops #1669
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a possibility for a player to be hidden from the jobs tops.
This pull request has made some change to perform that :
Change the way to hook Vault providers :
To check some permission (I'll explain later what), I have to add the provider of permissions. Accessible via
Jobs#getVaultPermission()
.To avoid some code repetitions (like logging or checking if Vault is enable) I created the abstract class
HookVault<T>
(where 'T' represent the class of the provider). And make theHookEconomyTask
extends it.Add 2 new permissions nodes :
jobs.hidetop.<job>
: hide the player (if it has the perm) to be shown in the top of the specified job (replace<job>
with*
to hide the player from all jobs top).jobs.hidegtop
hide the player from the jobs global top.The two nodes are by default set to
false
for all players.Make the use and creation of the list of jobs top asynchronous :
From the creation of the list of all players in the job tops and the moment where the top is shown to the player that performed the command, all of that is asynchronous.
This has been done because the check of a permission of a offline player (with Vault) has to be asynchronous if the server use LuckPerms and doesn't enable the
vault-unsafe-lookups
.