本文整理汇总了Java中com.elmakers.mine.bukkit.api.magic.Mage.getExperience方法的典型用法代码示例。如果您正苦于以下问题:Java Mage.getExperience方法的具体用法?Java Mage.getExperience怎么用?Java Mage.getExperience使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.elmakers.mine.bukkit.api.magic.Mage
的用法示例。
在下文中一共展示了Mage.getExperience方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: has
import com.elmakers.mine.bukkit.api.magic.Mage; //导入方法依赖的package包/类
public boolean has(Spell spell)
{
if (!(spell instanceof MageSpell)) return false;
Mage mage = ((MageSpell)spell).getMage();
int amount = getAmount(spell);
boolean hasItem = true;
if (item != null && amount > 0 && !isConsumeFree(spell))
{
hasItem = mage.hasItem(item.getItemStack(amount), item.getData() == null);
}
boolean hasXp = xp <= 0 || mage.getExperience() >= getXP(spell);
boolean hasMana = mana <= 0 || mage.getMana() >= getMana(spell);
boolean hasCurrency = currency <= 0;
if (!hasCurrency) {
VaultController vault = VaultController.getInstance();
hasCurrency = vault.has(mage.getPlayer(), getCurrency(spell));
}
return hasItem && hasXp && hasMana && hasCurrency;
}
示例2: hasItemCosts
import com.elmakers.mine.bukkit.api.magic.Mage; //导入方法依赖的package包/类
protected boolean hasItemCosts(CastContext context, ShopItem shopItem) {
Mage mage = context.getMage();
MageController controller = context.getController();
double worth = shopItem.getWorth();
boolean hasCosts = true;
if (worth > 0) {
if (isXP) {
worth = Math.ceil(costScale * worth * controller.getWorthBase() / controller.getWorthXP());
hasCosts = mage.getExperience() >= (int)(double)worth;
} else if (isItems) {
worth = Math.ceil(costScale * worth * controller.getWorthBase() / controller.getWorthItemAmount());
int hasAmount = getItemAmount(controller, mage);
hasCosts = hasAmount >= worth;
} else if (isSkillPoints) {
worth = Math.ceil(costScale * worth * controller.getWorthBase() / controller.getWorthSkillPoints());
hasCosts = mage.getSkillPoints() >= Math.ceil(worth);
} else {
worth = Math.ceil(costScale * worth * controller.getWorthBase());
hasCosts = VaultController.getInstance().has(mage.getPlayer(), worth);
}
}
return hasCosts;
}