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)) {
return false;
}
economy.withdrawPlayer(player, amount);
if (amount > 0) {
economy.withdrawPlayer(player, amount);
} else {
economy.depositPlayer(player, -amount);
}
}
return true;
}