Skip to content

Commit

Permalink
set to FALSE instead of attempting removal
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 1, 2025
1 parent 1da9a41 commit 6e9aac3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ private void checkForIllegalOp(Player player) {

for (String permission : blacklistedPermissions) {
if (AnarchyExploitFixes.permissions().permissionValue(player, permission) == TriState.TRUE) {
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.UNDEFINED);
if (shouldLog) warn("Removed illegal permission (" + permission + ") from player " + player.getName());
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.FALSE);
if (shouldLog) warn("Set illegal permission (" + permission + ") to FALSE for player " + player.getName() + ". ");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
public class PreventOppedPlayers extends AEFModule implements Listener {

private final Set<String> allowedOperators, blacklistedPermissions;
private final boolean logIsEnabled;
private final boolean shouldLog;

public PreventOppedPlayers() {
super("preventions.prevent-opped-players", false,
"Useful if you suspect a backdoor has happened.");
this.logIsEnabled = config.getBoolean(configPath + ".log", true);
this.shouldLog = config.getBoolean(configPath + ".log", true);
this.allowedOperators = new HashSet<>(config.getList(configPath + ".whitelisted-players", Collections.singletonList("Notch")));
this.blacklistedPermissions = new HashSet<>(config.getList(configPath + ".blacklisted-permissions", Collections.singletonList("*")));
}
Expand All @@ -46,13 +46,13 @@ private void checkForIllegalOp(Player player) {

if (player.isOp()) {
player.setOp(false);
if (logIsEnabled) warn(player.getName()+"'s operator status was set to false.");
if (shouldLog) warn(player.getName()+"'s operator status was set to false.");
}

for (String permission : blacklistedPermissions) {
if (AnarchyExploitFixes.permissions().permissionValue(player, permission) == TriState.TRUE) {
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.UNDEFINED);
if (logIsEnabled) warn("Removed illegal permission (" + permission + ") from player " + player.getName());
AnarchyExploitFixes.permissions().setPermission(player, permission, TriState.FALSE);
if (shouldLog) warn("Set illegal permission (" + permission + ") to FALSE for player " + player.getName() + ". ");
}
}
}
Expand Down

0 comments on commit 6e9aac3

Please sign in to comment.