mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-04 23:37:49 +01:00
Fixed issue when the pay is not work, #409
This commit is contained in:
parent
14253be043
commit
956acf8dd1
Binary file not shown.
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
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.economy.BufferedEconomy;
|
import com.gamingmesh.jobs.economy.BufferedEconomy;
|
||||||
import com.gamingmesh.jobs.economy.BufferedPayment;
|
import com.gamingmesh.jobs.economy.BufferedPayment;
|
||||||
@ -36,15 +38,14 @@ public class BufferedPaymentTask implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (payment.getAmount() > 0) {
|
if (payment.getAmount() > 0)
|
||||||
economy.depositPlayer(payment.getOfflinePlayer(), payment.getAmount());
|
Bukkit.getScheduler().runTask(Jobs.getInstance(), () -> economy.depositPlayer(payment.getOfflinePlayer(), payment.getAmount()));
|
||||||
} else {
|
else {
|
||||||
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.getAmount())) {
|
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.getAmount()))
|
||||||
bufferedEconomy.pay(payment);
|
bufferedEconomy.pay(payment);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payment.getPoints() != 0D)
|
if (payment.getPoints() != 0D)
|
||||||
Jobs.getPlayerManager().getPointsData().addPoints(payment.getOfflinePlayer().getUniqueId(), payment.getPoints());
|
Jobs.getPlayerManager().getPointsData().addPoints(payment.getOfflinePlayer().getUniqueId(), payment.getPoints());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user