本文整理匯總了Java中net.milkbowl.vault.economy.Economy.getBalance方法的典型用法代碼示例。如果您正苦於以下問題:Java Economy.getBalance方法的具體用法?Java Economy.getBalance怎麽用?Java Economy.getBalance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.milkbowl.vault.economy.Economy
的用法示例。
在下文中一共展示了Economy.getBalance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create
import net.milkbowl.vault.economy.Economy; //導入方法依賴的package包/類
/**
* Creates a PWI player.
*
* @param player the Bukkit player to base the player on
* @param group the group the player is in
* @return the created PWI player
*/
public PWIPlayer create(Player player, Group group) {
double balance = 0;
double bankBalance = 0;
if (plugin.isEconEnabled()) {
Economy economy = plugin.getEconomy();
bankBalance = economy.bankBalance(player.getName()).balance;
balance = economy.getBalance(player);
}
return new PWIPlayer(player, group, bankBalance, balance, bukkitService.shouldUseAttributes());
}
示例2: complete
import net.milkbowl.vault.economy.Economy; //導入方法依賴的package包/類
@Override
public CompletionStatus complete(Craft c) {
Economy e = SQContracts.get().getEconomy();
OfflinePlayer plr = Bukkit.getOfflinePlayer(player);
double bal = e.getBalance(plr);
if(bal >= cost){
e.withdrawPlayer(plr, cost);
return CompletionStatus.COMPLETE;
} else if(bal <= 0){
return CompletionStatus.INCOMPLETE;
} else {
e.withdrawPlayer(plr, bal);
return CompletionStatus.PARTIAL;
}
}
示例3: checkEverything
import net.milkbowl.vault.economy.Economy; //導入方法依賴的package包/類
public boolean checkEverything(Player p, CommandRank plugin)
{
double m;
if (this.economy) {
Economy e = plugin.getEconomy();
if (!e.hasAccount(p)) {
plugin.getMessager().sendMessage("Economy.AccountMissing", p);
return false;
}
m = e.getBalance(p);
if (m < this.price) {
p.sendMessage(plugin.getMessager().get("Economy.NotEnoughMoney").replace("%money%", Double.toString(m)).replace("%needed%", Double.toString(this.price)));
return false;
}
}
if ((this.onlineTime) &&
(plugin.getManager().getTime(p.getUniqueId()) < this.time)) {
plugin.getMessager().sendMessage("OnlineTime.NotEnoughTime", p);
return false;
}
if ((this.needXP) &&
(p.getLevel() < this.xp)) {
plugin.getMessager().sendMessage("XP.NotEnoughXP", p);
return false;
}
if (this.needItems) {
for (ItemStack i : this.itemsNeeded) {
if (!plugin.getItemChecker().inventoryContainsItem(p, i)) {
plugin.getMessager().sendMessage("NeedItems.NotEnoughItems." + this.name, p);
return false;
}
}
}
if ((this.needKills) &&
(plugin.getManager().getKills(p.getUniqueId()) < this.kills)) {
plugin.getMessager().sendMessage("Kills.NotEnoughKills", p);
return false;
}
return true;
}