Skip to content

Commit 6c4a5d0

Browse files
committed
improve logging messages
1 parent 6e9aac3 commit 6c4a5d0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/preventions/PreventOppedPlayers.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ public void disable() {
4444
private void checkForIllegalOp(Player player) {
4545
if (allowedOperators.contains(player.getName())) return;
4646

47-
if (player.isOp() || player.hasPermission("*")) {
47+
if (player.isOp()) {
48+
if (shouldLog) warn(player.getName()+" is not in the operators whitelist. Removing operator status.");
4849
player.setOp(false);
49-
if (shouldLog) warn(player.getName()+"'s operator status was set to false.");
5050
}
5151

5252
for (String permission : blacklistedPermissions) {
5353
if (AnarchyExploitFixes.permissions().permissionValue(player, permission) == TriState.TRUE) {
54+
if (shouldLog) warn(player.getName() + " was found with an illegal permission: '" + permission + "'. Setting it explicitly FALSE.");
5455
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.FALSE);
55-
if (shouldLog) warn("Set illegal permission (" + permission + ") to FALSE for player " + player.getName() + ". ");
5656
}
5757
}
5858
}

AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/preventions/PreventOppedPlayers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ private void checkForIllegalOp(Player player) {
4545
if (allowedOperators.contains(player.getName())) return;
4646

4747
if (player.isOp()) {
48+
if (shouldLog) warn(player.getName()+" is not in the operators whitelist. Removing operator status.");
4849
player.setOp(false);
49-
if (shouldLog) warn(player.getName()+"'s operator status was set to false.");
5050
}
5151

5252
for (String permission : blacklistedPermissions) {
5353
if (AnarchyExploitFixes.permissions().permissionValue(player, permission) == TriState.TRUE) {
54+
if (shouldLog) warn(player.getName() + " was found with an illegal permission: '" + permission + "'. Setting it explicitly FALSE.");
5455
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.FALSE);
55-
if (shouldLog) warn("Set illegal permission (" + permission + ") to FALSE for player " + player.getName() + ". ");
5656
}
5757
}
5858
}

0 commit comments

Comments
 (0)