From e3cab3633e5185b7282f30e87bf235d0805ae19b Mon Sep 17 00:00:00 2001 From: ile123ile Date: Mon, 1 Sep 2014 19:02:32 -0700 Subject: [PATCH] Can now check if player has permissions for secondary ability and whether it's activation was successful --- 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 e770d8731..b83e03652 100644 --- a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java @@ -13,7 +13,9 @@ import com.gmail.nossr50.datatypes.skills.SecondaryAbility; import com.gmail.nossr50.datatypes.skills.SkillType; import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.skills.SkillAbilityManager; +import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; +import com.gmail.nossr50.util.skills.SkillUtils; public final class AbilityAPI { private AbilityAPI() {} @@ -132,6 +134,14 @@ public final class AbilityAPI { return ability; } + public static boolean hasSecondaryAbilityPermissions(Player player, SecondaryAbility ability) { + return Permissions.secondaryAbilityEnabled(player, ability); + } + + public static boolean wasSecondaryAbilityActivationSuccessful(SecondaryAbility skillAbility, Player player, SkillType skill) { + return SkillUtils.activationSuccessful(skillAbility, player, skill); + } + public static void activateSkillAbility(SkillType skill, Player player, BlockState blockState) { SkillAbilityManager abilityManager = SkillAPI.getSkillAbilityManager(skill, player); if(abilityManager != null) {