Uses depositPlayer for negative economy transactions

This commit is contained in:
2023-08-11 14:42:37 +02:00
parent 0dfbcb0b54
commit e85f133bc2

View File

@@ -182,7 +182,11 @@ public final class EconomyHelper {
if (!economy.has(player, amount)) { if (!economy.has(player, amount)) {
return false; return false;
} }
if (amount > 0) {
economy.withdrawPlayer(player, amount); economy.withdrawPlayer(player, amount);
} else {
economy.depositPlayer(player, -amount);
}
} }
return true; return true;
} }