From 4b93dede336bfbbb7adfa99a77f80b2b904a1cc6 Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 25 Jun 2012 10:35:47 -0400 Subject: [PATCH] Add ability to check if any ability is enabled. --- src/main/java/com/gmail/nossr50/api/AbilityAPI.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java index e787e5d33..da5dabb5e 100644 --- a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/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; + } }