mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 14:29:07 +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;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.economy.BufferedEconomy;
|
||||
import com.gamingmesh.jobs.economy.BufferedPayment;
|
||||
@ -36,15 +38,14 @@ public class BufferedPaymentTask implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (payment.getAmount() > 0) {
|
||||
economy.depositPlayer(payment.getOfflinePlayer(), payment.getAmount());
|
||||
} else {
|
||||
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.getAmount())) {
|
||||
if (payment.getAmount() > 0)
|
||||
Bukkit.getScheduler().runTask(Jobs.getInstance(), () -> economy.depositPlayer(payment.getOfflinePlayer(), payment.getAmount()));
|
||||
else {
|
||||
if (!economy.withdrawPlayer(payment.getOfflinePlayer(), -payment.getAmount()))
|
||||
bufferedEconomy.pay(payment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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