Advertisement
Exception_Prototype

Untitled

Apr 30th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1.     private Economy economy = null;
  2.  
  3.     @Override
  4.     public void onEnable() {
  5.         if (!setupEconomy()) {
  6.             LOGGER.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
  7.             getServer().getPluginManager().disablePlugin(this);
  8.             return;
  9.         }
  10.     }
  11.  
  12.     private boolean setupEconomy() {
  13.         if (getServer().getPluginManager().getPlugin("Vault") == null) {
  14.             return false;
  15.         }
  16.         RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
  17.         if (rsp == null) {
  18.             return false;
  19.         }
  20.         economy = rsp.getProvider();
  21.         return economy != null;
  22.     }
  23.  
  24.     public Economy getEconomy() {
  25.         return this.economy;
  26.     }
  27.  
  28.     //getEconomy().has(p, count) - проверить если на указанная сумма на счёте у игрока.
  29.     //getEconomy().depositPlayer(p, count) - положить на счёт игрока указанную сумму.
  30.     //getEconomy().withdrawPlayer(p, count) - снять указанную сумму с счёта игрока.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement