1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Async economy should be async...

This commit is contained in:
Zrips 2022-03-09 15:49:07 +02:00
parent b35bdd5087
commit c4dfa50a16

View File

@ -41,8 +41,7 @@ public class BufferedPaymentTask implements Runnable {
double money = payment.get(CurrencyType.MONEY);
if (money > 0) {
if (Jobs.getGCManager().isEconomyAsync()) {
org.bukkit.Bukkit.getScheduler().scheduleSyncDelayedTask(bufferedEconomy.getPlugin(), () ->
economy.depositPlayer(payment.getOfflinePlayer(), money));
org.bukkit.Bukkit.getScheduler().runTaskAsynchronously(bufferedEconomy.getPlugin(), () -> economy.depositPlayer(payment.getOfflinePlayer(), money));
} else {
economy.depositPlayer(payment.getOfflinePlayer(), money);
}