Skip to content

Commit

Permalink
add empty check for ActionApplier & RequirementApplier
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Feb 24, 2024
1 parent f6818fc commit 80b6aaa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/me/hsgamer/bettergui/action/ActionApplier.java
Expand Up @@ -40,6 +40,15 @@ public ActionApplier(Menu menu, Object value) {
this(ActionBuilder.INSTANCE.build(menu, value));
}

/**
* Check if the applier is empty
*
* @return true if it is empty
*/
public boolean isEmpty() {
return actions.isEmpty();
}

/**
* Apply the action to the process without the next action
*
Expand Down
Expand Up @@ -108,6 +108,15 @@ public static Map<BukkitClickType, RequirementApplier> convertClickRequirementAp
return clickRequirements;
}

/**
* Check if the applier is empty
*
* @return true if it is empty
*/
public boolean isEmpty() {
return requirementSets.isEmpty() && failActionApplier.isEmpty();
}

/**
* Get the result of the requirement
*
Expand Down

0 comments on commit 80b6aaa

Please sign in to comment.