Can now check if player has permissions for secondary ability and

whether it's activation was successful
This commit is contained in:
ile123ile 2014-09-01 19:02:32 -07:00
parent 28419e1dc3
commit e3cab3633e

View File

@ -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) {