1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-21 15:41:19 +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); double money = payment.get(CurrencyType.MONEY);
if (money > 0) { if (money > 0) {
if (Jobs.getGCManager().isEconomyAsync()) { if (Jobs.getGCManager().isEconomyAsync()) {
org.bukkit.Bukkit.getScheduler().scheduleSyncDelayedTask(bufferedEconomy.getPlugin(), () -> org.bukkit.Bukkit.getScheduler().runTaskAsynchronously(bufferedEconomy.getPlugin(), () -> economy.depositPlayer(payment.getOfflinePlayer(), money));
economy.depositPlayer(payment.getOfflinePlayer(), money));
} else { } else {
economy.depositPlayer(payment.getOfflinePlayer(), money); economy.depositPlayer(payment.getOfflinePlayer(), money);
} }