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


Java Economy類代碼示例

本文整理匯總了Java中net.milkbowl.vault.economy.Economy的典型用法代碼示例。如果您正苦於以下問題:Java Economy類的具體用法?Java Economy怎麽用?Java Economy使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Economy類屬於net.milkbowl.vault.economy包,在下文中一共展示了Economy類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
/**
 * This method will test if Vault is installed and if there is a
 * registered Economy Plugin. This method will only return true
 * if there is an economy plugin that is registered and if Vault
 * is installed and enabled.
 */
private boolean setupEconomy ()
{
    if (null == getServer().getPluginManager ().getPlugin ("Vault"))
    {
        getLogger ().severe ("Vault is not Installed! Disabling Plugin");
        return false;
    }

    RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager ().getRegistration (Economy.class);

    if (null == rsp)
    {
        getLogger ().severe ("No Economy Plugin Found! Disabling Plugin");
        return false;
    }

    mEconomy = rsp.getProvider ();
    return mEconomy != null;
}
 
開發者ID:MagnaRisa,項目名稱:CraftyProfessions,代碼行數:26,代碼來源:CraftyProfessions.java

示例2: pay

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public boolean pay(Player player) {
    double c = cost.resolve(player);
    if (c > 0) {
        Economy eco = EconomyManager.getEconomy();
        if (eco == null) {
            Uppercore.logger().severe("Cannot use economy: vault not found!");
            return true;
        }
        EconomyResponse res = eco.withdrawPlayer(player, c);
        if (!res.transactionSuccess()) {
            noMoneyError.send(player);
            if (noMoneySound != null)
                noPermissionSound.play(player);
            Uppercore.logger().log(Level.INFO, res.errorMessage);
            return false;
        } else return true;
    }
    return true;
}
 
開發者ID:upperlevel,項目名稱:uppercore,代碼行數:20,代碼來源:ConfigIcon.java

示例3: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public void onEnable(){
	instance = this;
	manager = new Manager(instance);
	manager.check();

	files.setupFiles();
	lang.setupLang();

	registerEvents();
	registerCommands();

       RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
       if (economyProvider != null) {
           vault = economyProvider.getProvider();
       }

       WCCore.getInstance().log("Pvpmanager ha sido cargado");
}
 
開發者ID:cadox8,項目名稱:WC,代碼行數:19,代碼來源:WCPvP.java

示例4: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public void onEnable() {
    instance = this;

    RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
    if (economyProvider != null) {
        eco = economyProvider.getProvider();
    } else {
        getServer().getPluginManager().disablePlugin(this);
        WCCore.getInstance().log(WCServer.Level.SEVERE, "No hay Vault");
        return;
    }

    register();
    files.setupFiles();
    registerCommands();
    registerEvents();
    loadCasinos();
    info.init();

    mainRun.runTaskTimer(this, 0, 20);
    WCCore.getInstance().log(WCServer.Level.INFO, "Survival activado");
}
 
開發者ID:cadox8,項目名稱:WC,代碼行數:23,代碼來源:WCSurvival.java

示例5: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
private boolean setupEconomy() {
    if (getServer().getPluginManager().getPlugin("Vault") == null){
        Log.debugLog("Oye, que el Economy es null 1");
        return false;
    }

    RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
    if (rsp == null){
        Log.debugLog("Oye, que el Economy es null 2");
        return false;
    }

    vault = rsp.getProvider();
    Log.debugLog("Oye, que el Economy ha cargao mi arma");
    return vault != null;
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:17,代碼來源:PASurvival.java

示例6: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public void onEnable(){
    instance = this;
    files.setupFiles();

    registerEvents();
    registerCommands();
    pe.registerRecipe();

    RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
    if (economyProvider != null) {
        eco = economyProvider.getProvider();
    }

    Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
    if (plugin != null) {
        wg = WGBukkit.getPlugin();
    }
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:19,代碼來源:SafariNet.java

示例7: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
/**
 * Setup vault
 */
private boolean setupEconomy()
{
	if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) 
       {
           return false;
       }
       
       RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
       if (rsp == null) 
       {
           return false;
       }
       
       vault = rsp.getProvider();
       
       return vault != null;
}
 
開發者ID:austinpilz,項目名稱:ServerSync,代碼行數:21,代碼來源:Vault.java

示例8: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public void onEnable()
{
 this.DisabledPlayersHashMap = new HashMap<String, Boolean>();
 this.DisabledEntitiesHashMap = new HashMap<Object, Boolean>();
 this.MobsTimerHashMap = new HashMap<String, Integer>();
  if ((Bukkit.getPluginManager().getPlugin("Vault") instanceof Vault))
  {
    RegisteredServiceProvider<Economy> service = Bukkit.getServicesManager().getRegistration(Economy.class);
    if (service != null) {
      eco = (Economy)service.getProvider();
    }
  }
  else
  {
    System.out.print("[MobMoney] Error with Vault, it's necessary to starts this plugin.");
    getServer().getPluginManager().disablePlugin(this);
  }
  onReloadConfig();
  setConfig();
  getServer().getPluginManager().registerEvents(this, this);
  System.out.print("[MobMoney] Enabled correctly.");
}
 
開發者ID:AnonymousDr,項目名稱:ADR,代碼行數:23,代碼來源:mobs.java

示例9: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
@Override
public void onEnable() {
	
	if(this.getServer().getPluginManager().isPluginEnabled("Vault")) {
		economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
	}
	
	fillTradeTable();
	
	//_location = new Location(getServer().getWorld("world"), -163.0, 71.0, 145.0); // server test punisher
	_location = new Location(getServer().getWorld("world"), 691.0,69.0,276.0); // shop village
	_zone = new WorldZone(_location, 5);
	//_zone = new WorldZone(getServer().getWorld("world"), "-167,140,-159,150,69,75");
	_villager = (Villager)getServer().getWorld("world").spawnCreature(_location, EntityUtilities.getCreatureType("Villager"));
	_location = _villager.getLocation(); 		
	getServer().getPluginManager().registerEvents(this, this);
	getCommand("tv").setExecutor(this);

	Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(this, 0, 100, TimeUnit.MILLISECONDS);

	ZoneServer.getInstance().addListener(this);
	
	
}
 
開發者ID:Allov,項目名稱:world-of-icerealm,代碼行數:25,代碼來源:TrashVendorPlugin.java

示例10: onLoad

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
@Override
public void onLoad() {
    pool = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
    manager = new Manager(this);

    getServer().getServicesManager().register(
            MyEconomy.class,
            manager,
            this,
            ServicePriority.Normal
    );

    Plugin vault = getServer().getPluginManager().getPlugin("Vault");
    if (vault != null) {
        getServer().getServicesManager().register(
                Economy.class,
                new VaultEconomy(this, manager),
                this,
                ServicePriority.Highest
        );
        getLogger().info("Hook to vault!!!");
    }
}
 
開發者ID:caoli5288,項目名稱:economy,代碼行數:24,代碼來源:Main.java

示例11: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
private boolean setupEconomy() {
    if (!CubitBukkitPlugin.inst().getYamlManager().getSettings().landEnableEconomy) {
        this.plugin.getLogger().info("Economy is in config disabled!");
        return false;
    }
    if (plugin.getServer().getPluginManager().getPlugin("Vault") == null) {
        return false;
    }
    RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);
    if (rsp == null) {
        this.plugin.getLogger().info("No valid economy plugin found. Economy is disabled.");
        return false;
    }
    econ = rsp.getProvider();
    return econ != null;
}
 
開發者ID:MineGaming,項目名稱:cubit,代碼行數:17,代碼來源:VaultManager.java

示例12: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
private boolean setupEconomy() {
    econ = null;
    //檢查設定
    FileConfiguration config = KConfigManager.get("config");
    //若無啟用經濟
    if (!config.getBoolean("Economy.Enable", false)) {
        return false;
    }

    //檢查Vault
    if (getServer().getPluginManager().getPlugin("Vault") == null) {
        return false;
    }
    //檢查經濟支援
    RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
    if (rsp == null) {
        return false;
    }
    econ = rsp.getProvider();
    return econ != null;
}
 
開發者ID:jyhsu2000,項目名稱:BannerMaker,代碼行數:22,代碼來源:BannerMaker.java

示例13: setupEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
private boolean setupEconomy() {
    if (getServer().getPluginManager().getPlugin("Vault") != null) {
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        
        if (rsp != null) {
            vaultEconomy = rsp.getProvider();
            
            if (vaultEconomy != null) {
                return true;
            } else {
                log.warning("Failed to get Vault economy; aborting Vault mode.");
            }
        } else {
            log.warning("No provider for Vault; is a Vault-compatible economy plugin present? Aborting Vault mode.");
        }
    } else {
        log.info("Vault not present; aborting Vault mode.");
    }
    
    return false;
}
 
開發者ID:RedPanda4552,項目名稱:SimpleEgg,代碼行數:22,代碼來源:Main.java

示例14: serializeEconomy

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
public static JSONObject serializeEconomy(Player player, Economy econ) {
    try {
        JSONObject data = new JSONObject();

        if (econ.bankBalance(player.getName()).transactionSuccess()) {
            data.put("bank-balance", econ.bankBalance(player.getName()).balance);
        }

        data.put("balance", econ.getBalance(String.valueOf(player)));

        return data;
    } catch (JSONException ex) {
        ex.printStackTrace();
        return null;
    }
}
 
開發者ID:ThisIzEthan,項目名稱:NexusInventory,代碼行數:17,代碼來源:EconomySerialization.java

示例15: onEnable

import net.milkbowl.vault.economy.Economy; //導入依賴的package包/類
@Override
public void onEnable()
{
	ServicesManager sm = handler.getServer().getServicesManager();

	RegisteredServiceProvider<Permission> permProvider = sm.getRegistration(Permission.class);
	if (permProvider != null)
		perm = permProvider.getProvider();

	RegisteredServiceProvider<Economy> econProvider = sm.getRegistration(Economy.class);
	if (econProvider != null)
		econ = econProvider.getProvider();

	RegisteredServiceProvider<Chat> chatProvider = sm.getRegistration(Chat.class);
	if (chatProvider != null)
		chat = chatProvider.getProvider();
}
 
開發者ID:dmulloy2,項目名稱:SwornAPI,代碼行數:18,代碼來源:VaultHandler.java


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