mcMMO/src/main/java/com/gmail/nossr50/api/AbilityAPI.java

52 lines
1.8 KiB
Java
Raw Normal View History

2012-06-25 16:05:47 +02:00
package com.gmail.nossr50.api;
import org.bukkit.entity.Player;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.skills.utilities.AbilityType;
2012-06-25 16:05:47 +02:00
import com.gmail.nossr50.util.Users;
2013-01-26 23:01:55 +01:00
public final class AbilityAPI {
private AbilityAPI() {}
2012-06-25 16:05:47 +02:00
public static boolean berserkEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.BERSERK);
2012-06-25 16:05:47 +02:00
}
public static boolean gigaDrillBreakerEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.GIGA_DRILL_BREAKER);
2012-06-25 16:05:47 +02:00
}
public static boolean greenTerraEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.GREEN_TERRA);
2012-06-25 16:05:47 +02:00
}
public static boolean serratedStrikesEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.SERRATED_STRIKES);
2012-06-25 16:05:47 +02:00
}
public static boolean skullSplitterEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.SKULL_SPLITTER);
2012-06-25 16:05:47 +02:00
}
public static boolean superBreakerEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.SUPER_BREAKER);
2012-06-25 16:05:47 +02:00
}
public static boolean treeFellerEnabled(Player player) {
return Users.getPlayer(player).getProfile().getAbilityMode(AbilityType.TREE_FELLER);
2012-06-25 16:05:47 +02:00
}
public static boolean isAnyAbilityEnabled(Player player) {
PlayerProfile profile = Users.getPlayer(player).getProfile();
for (AbilityType ability : AbilityType.values()) {
if (profile.getAbilityMode(ability)) {
return true;
}
}
return false;
}
2012-06-25 16:05:47 +02:00
}