Ejemplo n.º 1
0
 @Override
 public void pay(String playername, double amount) {
   try {
     Economy.add(playername, amount);
   } catch (UserDoesNotExistException e) {
     e.printStackTrace();
   } catch (NoLoanPermittedException e) {
     e.printStackTrace();
   }
 }
Ejemplo n.º 2
0
 @Override
 public void updateStats(String playername) {
   // stats plugin integration
   if (plugin.getJobsConfiguration().getStats() != null
       && plugin.getJobsConfiguration().getStats().isEnabled()) {
     Stats stats = plugin.getJobsConfiguration().getStats();
     double balance;
     try {
       balance = Economy.getMoney(playername);
     } catch (UserDoesNotExistException e) {
       e.printStackTrace();
       return;
     }
     if (balance > stats.get(playername, "job", "money")) {
       stats.setStat(playername, "job", "money", (int) balance);
       stats.saveAll();
     }
   }
 }