use of com.archyx.aureliumskills.data.PlayerData in project AureliumSkills by Archy-X.
the class SkillsCommand method onClaimItems.
@Subcommand("claimitems")
@CommandPermission("aureliumskills.claimitems")
public void onClaimItems(Player player) {
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
Locale locale = Lang.getDefaultLanguage();
if (playerData != null) {
locale = playerData.getLocale();
}
if (playerData == null || playerData.getUnclaimedItems().size() == 0) {
player.sendMessage(AureliumSkills.getPrefix(locale) + Lang.getMessage(CommandMessage.CLAIMITEMS_NO_ITEMS, locale));
return;
}
UnclaimedItemsMenu.getInventory(plugin, playerData).open(player);
}
use of com.archyx.aureliumskills.data.PlayerData in project AureliumSkills by Archy-X.
the class AbilityProvider method getXp.
public double getXp(Player player, Source source, Ability ability) {
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
if (playerData != null) {
double output = plugin.getSourceManager().getXp(source);
if (ability != null) {
if (plugin.getAbilityManager().isEnabled(ability)) {
double modifier = 1;
modifier += plugin.getAbilityManager().getValue(ability, playerData.getAbilityLevel(ability)) / 100;
output *= modifier;
}
}
return output;
}
return 0.0;
}
use of com.archyx.aureliumskills.data.PlayerData in project AureliumSkills by Archy-X.
the class ManaCommand method onManaRemove.
@Subcommand("remove")
@CommandPermission("aureliumskills.mana.remove")
@CommandCompletion("@players")
@Description("Removes mana from a player")
public void onManaRemove(CommandSender sender, @Flags("other") Player player, double amount, @Default("false") boolean silent) {
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
if (playerData == null)
return;
Locale locale = playerData.getLocale();
if (amount >= 0) {
if (playerData.getMana() - amount >= 0) {
playerData.setMana(playerData.getMana() - amount);
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + TextUtil.replace(Lang.getMessage(CommandMessage.MANA_REMOVE, locale), "{amount}", NumberUtil.format2(amount), "{player}", player.getName()));
}
} else {
double removed = playerData.getMana();
playerData.setMana(0);
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + TextUtil.replace(Lang.getMessage(CommandMessage.MANA_REMOVE, locale), "{amount}", NumberUtil.format2(removed), "{player}", player.getName()));
}
}
} else {
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + Lang.getMessage(CommandMessage.MANA_AT_LEAST_ZERO, locale));
}
}
}
use of com.archyx.aureliumskills.data.PlayerData in project AureliumSkills by Archy-X.
the class ManaCommand method onManaSet.
@Subcommand("set")
@CommandPermission("aureliumskills.mana.set")
@CommandCompletion("@players @nothing false|true")
@Description("Sets the mana of player")
public void onManaSet(CommandSender sender, @Flags("other") Player player, double amount, @Default("true") boolean allowOverMax, @Default("false") boolean silent) {
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
if (playerData == null)
return;
Locale locale = playerData.getLocale();
if (amount >= 0) {
if (allowOverMax && OptionL.getBoolean(Option.WISDOM_ALLOW_OVER_MAX_MANA)) {
playerData.setMana(amount);
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + TextUtil.replace(Lang.getMessage(CommandMessage.MANA_SET, locale), "{amount}", NumberUtil.format2(amount), "{player}", player.getName()));
}
} else {
if (amount <= playerData.getMaxMana()) {
playerData.setMana(amount);
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + TextUtil.replace(Lang.getMessage(CommandMessage.MANA_SET, locale), "{amount}", NumberUtil.format2(amount), "{player}", player.getName()));
}
} else {
playerData.setMana(playerData.getMaxMana());
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + TextUtil.replace(Lang.getMessage(CommandMessage.MANA_SET, locale), "{amount}", NumberUtil.format2(playerData.getMaxMana()), "{player}", player.getName()));
}
}
}
} else {
if (!silent) {
sender.sendMessage(AureliumSkills.getPrefix(locale) + Lang.getMessage(CommandMessage.MANA_AT_LEAST_ZERO, locale));
}
}
}
use of com.archyx.aureliumskills.data.PlayerData in project AureliumSkills by Archy-X.
the class SkillLeveler method getXp.
public double getXp(Player player, double input) {
PlayerData playerData = plugin.getPlayerManager().getPlayerData(player);
if (playerData != null) {
double output = input;
if (ability != null) {
if (plugin.getAbilityManager().isEnabled(ability)) {
double modifier = 1;
modifier += plugin.getAbilityManager().getValue(ability, playerData.getAbilityLevel(ability)) / 100;
output *= modifier;
}
}
return output;
}
return 0.0;
}
Aggregations