浏览代码

Add ability to check if any ability is enabled.

GJ 13 年之前
父节点
当前提交
4b93dede33
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      src/main/java/com/gmail/nossr50/api/AbilityAPI.java

+ 10 - 0
src/main/java/com/gmail/nossr50/api/AbilityAPI.java

@@ -34,4 +34,14 @@ public class AbilityAPI {
     public static boolean treeFellerEnabled(Player player) {
         return Users.getProfile(player).getAbilityMode(AbilityType.TREE_FELLER);
     }
+
+    public static boolean isAnyAbilityEnabled(Player player) {
+        for (AbilityType ability : AbilityType.values()) {
+            if (Users.getProfile(player).getAbilityMode(ability)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
 }