mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-27 04:55:33 +01:00
use math.round for GoldIsMoney
This commit is contained in:
parent
90a9987891
commit
396da3f3a4
@ -82,7 +82,7 @@ public class Economy_GoldIsMoney implements Economy {
|
|||||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds");
|
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot withdraw negative funds");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GoldIsMoney.has(playerName, (long) amount)) {
|
if (GoldIsMoney.has(playerName, Math.round(amount))) {
|
||||||
GoldIsMoney.withdrawPlayer(playerName, (long) amount);
|
GoldIsMoney.withdrawPlayer(playerName, (long) amount);
|
||||||
return new EconomyResponse(amount, getAccountBalance(playerName), ResponseType.SUCCESS, null);
|
return new EconomyResponse(amount, getAccountBalance(playerName), ResponseType.SUCCESS, null);
|
||||||
} else {
|
} else {
|
||||||
@ -96,7 +96,7 @@ public class Economy_GoldIsMoney implements Economy {
|
|||||||
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot desposit negative funds");
|
return new EconomyResponse(0, 0, ResponseType.FAILURE, "Cannot desposit negative funds");
|
||||||
}
|
}
|
||||||
|
|
||||||
GoldIsMoney.depositPlayer(playerName, (long) amount);
|
GoldIsMoney.depositPlayer(playerName, Math.round(amount));
|
||||||
return new EconomyResponse(amount, GoldIsMoney.getBalance(playerName), EconomyResponse.ResponseType.SUCCESS, null);
|
return new EconomyResponse(amount, GoldIsMoney.getBalance(playerName), EconomyResponse.ResponseType.SUCCESS, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ public class Economy_GoldIsMoney implements Economy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(double amount) {
|
public String format(double amount) {
|
||||||
return GoldIsMoney.format((long) Math.round(amount));
|
return GoldIsMoney.format(Math.round(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user