mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36:46 +01:00
Can now check if player has permissions for secondary ability and
whether it's activation was successful
This commit is contained in:
parent
28419e1dc3
commit
e3cab3633e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user