mirror of
https://github.com/Zrips/Jobs.git
synced 2024-12-30 21:07:48 +01:00
Fix for issue with server account determination and usage causing
payments to be stopped
This commit is contained in:
parent
c5863bb121
commit
ffd4309de7
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>Jobs</groupId>
|
||||
<artifactId>jobs</artifactId>
|
||||
<version>5.2.1.2</version>
|
||||
<version>5.2.2.0</version>
|
||||
<name>Jobs</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class BufferedEconomy {
|
||||
/**
|
||||
* Payout all players the amount they are going to be paid
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
|
||||
public void payAll() {
|
||||
if (payments.isEmpty() || !plugin.isEnabled())
|
||||
return;
|
||||
@ -163,6 +163,9 @@ public class BufferedEconomy {
|
||||
}
|
||||
}
|
||||
|
||||
boolean hasMoney = false;
|
||||
if (Jobs.getGCManager().UseServerAccount) {
|
||||
try {
|
||||
String serverAccountName = Jobs.getGCManager().ServerAccountName;
|
||||
|
||||
if (serverTaxesAccount == null)
|
||||
@ -179,17 +182,21 @@ public class BufferedEconomy {
|
||||
}
|
||||
}
|
||||
|
||||
boolean hasMoney = false;
|
||||
if (Jobs.getGCManager().UseServerAccount && economy.hasMoney(serverAccountName, totalAmount)) {
|
||||
if (economy.hasMoney(serverAccountName, totalAmount)) {
|
||||
hasMoney = true;
|
||||
economy.withdrawPlayer(serverAccountName, totalAmount);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// Schedule all payments
|
||||
int i = 0;
|
||||
for (BufferedPayment payment : paymentCache.values()) {
|
||||
i++;
|
||||
|
||||
try {
|
||||
if (payment.getOfflinePlayer() == null)
|
||||
continue;
|
||||
|
||||
@ -219,6 +226,9 @@ public class BufferedEconomy {
|
||||
if (Version.getCurrent().isHigher(Version.v1_8_R3) && payment.getOfflinePlayer().isOnline()) {
|
||||
Jobs.getBBManager().ShowJobProgression(Jobs.getPlayerManager().getJobsPlayer(payment.getOfflinePlayer().getUniqueId()));
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// empty payment cache
|
||||
|
Loading…
Reference in New Issue
Block a user