當前位置: 首頁>>代碼示例>>Java>>正文


Java Economy.getBalance方法代碼示例

本文整理匯總了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());
}
 
開發者ID:Gnat008,項目名稱:PerWorldInventory,代碼行數:19,代碼來源:PWIPlayerFactory.java

示例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;
	}
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:16,代碼來源:MoneyContract.java

示例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;
}
 
開發者ID:Blackixx,項目名稱:CommandRank,代碼行數:49,代碼來源:RankUp.java


注:本文中的net.milkbowl.vault.economy.Economy.getBalance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。