1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +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; package com.gamingmesh.jobs.tasks;
import org.bukkit.Bukkit;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.container.CurrencyType; import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.economy.BufferedEconomy; import com.gamingmesh.jobs.economy.BufferedEconomy;
@ -40,7 +38,7 @@ public class BufferedPaymentTask implements Runnable {
@Override @Override
public void run() { public void run() {
if (payment.get(CurrencyType.MONEY) > 0) 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 { else {
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.get(CurrencyType.MONEY))) if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.get(CurrencyType.MONEY)))
bufferedEconomy.pay(payment); bufferedEconomy.pay(payment);