mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Turn off socialspy on login if player doesn't have the permission.
This fixes the case where players had socialspy enabled, lost the permission for it (got demoted) and then someone had to manually check and disable it for them as described in #299.
This commit is contained in:
parent
1a701e69ca
commit
6fc19b92eb
1 changed files with 5 additions and 0 deletions
|
@ -284,6 +284,11 @@ public class EssentialsPlayerListener implements Listener {
|
|||
user.getBase().setWalkSpeed(0.2f);
|
||||
}
|
||||
|
||||
if (user.isSocialSpyEnabled() && !user.isAuthorized("essentials.socialspy")) {
|
||||
user.setSocialSpyEnabled(false);
|
||||
ess.getLogger().log(Level.INFO, "Set socialspy to false for {0} because they had it enabled without permission.", user.getName());
|
||||
}
|
||||
|
||||
user.stopTransaction();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue