mirror of
https://github.com/amalthea-mc/Ore-Market.git
synced 2024-11-09 12:11:08 +00:00
Implement handling 0% tax
This commit is contained in:
parent
05627a4b33
commit
841779c52b
@ -32,8 +32,13 @@ public class InventoryEvents implements Listener {
|
|||||||
OreMarket.getEconomy().depositPlayer((OfflinePlayer) Player, Money);
|
OreMarket.getEconomy().depositPlayer((OfflinePlayer) Player, Money);
|
||||||
}
|
}
|
||||||
public void takeMoney (double Money, HumanEntity Player) { // Buy
|
public void takeMoney (double Money, HumanEntity Player) { // Buy
|
||||||
double tax = OreMarket.main().getConfig().getDouble("tax");
|
double tax = OreMarket.main().getConfig().getDouble("tax", 0.0);
|
||||||
double total = (Money + (Money/tax));
|
double total;
|
||||||
|
if (tax == 0.0) {
|
||||||
|
total = Money;
|
||||||
|
} else {
|
||||||
|
total = (Money + (Money/tax));
|
||||||
|
}
|
||||||
OreMarket.getEconomy().withdrawPlayer((OfflinePlayer) Player, total);
|
OreMarket.getEconomy().withdrawPlayer((OfflinePlayer) Player, total);
|
||||||
}
|
}
|
||||||
public double balance (HumanEntity Player) {
|
public double balance (HumanEntity Player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user