Beispiel #1
0
  public void transferMoney(UUID from, UUID to, double amount) {
    new Thread(
            () -> {
              PlayerData fromData = getData(from);
              PlayerData toData = getData(to);

              fromData.creditMoney(-amount);
              toData.creditMoney(amount);
            })
        .start();
  }
Beispiel #2
0
 public void giveMoney(UUID player, double amount, FinancialCallback callback) {
   new Thread(
           () -> {
             PlayerData data = getData(player);
             data.creditMoney(amount);
             if (callback != null) callback.done(data.getMoney(), amount);
           })
       .start();
 }