Skip to content

Commit

Permalink
Made Disabled checks actually disable
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagdedes2 committed Oct 19, 2024
1 parent 76582e8 commit 745a343
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/net/gteam/wave/checks/CheckHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class CheckHolder {
private final Profile profile;
private Check[] checks;
private int checksSize;
private boolean testing; //Used for testing new checks

public CheckHolder(final Profile profile) {
this.profile = profile;
Expand Down Expand Up @@ -53,7 +52,7 @@ private void addChecks(final Check... checks) {

for (final Check check : checks) {

//if (this.profile != null && (!check.isEnabled() || isDisabled(check))) continue; // TODO: fix (it just doesn't register any checks if enabled)
if (this.profile != null && isDisabled(check)) continue;

this.checks = Arrays.copyOf(this.checks, this.checksSize + 1);

Expand All @@ -65,9 +64,7 @@ private void addChecks(final Check... checks) {

private boolean isDisabled(final Check check) {

if (this.testing) return true;

if (check.getClass().isAnnotationPresent(Disabled.class)) this.testing = true;
if (check.getClass().isAnnotationPresent(Disabled.class)) return true;

return false;
}
Expand Down

0 comments on commit 745a343

Please sign in to comment.