1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Don't force economy to be done in sync...

This commit is contained in:
Zrips 2019-09-22 11:51:07 +03:00
parent 5c7c4621e5
commit 9a73f1eb0d

View File

@ -18,8 +18,6 @@
package com.gamingmesh.jobs.tasks;
import org.bukkit.Bukkit;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.economy.BufferedEconomy;
@ -40,7 +38,7 @@ public class BufferedPaymentTask implements Runnable {
@Override
public void run() {
if (payment.get(CurrencyType.MONEY) > 0)
Bukkit.getScheduler().runTask(Jobs.getInstance(), () -> economy.depositPlayer(payment.getOfflinePlayer(), payment.get(CurrencyType.MONEY)));
economy.depositPlayer(payment.getOfflinePlayer(), payment.get(CurrencyType.MONEY));
else {
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.get(CurrencyType.MONEY)))
bufferedEconomy.pay(payment);