1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

Autojoin job fix

This commit is contained in:
Zrips 2022-11-17 16:40:57 +02:00
parent fd3c420f08
commit bf06440811
4 changed files with 2870 additions and 2825 deletions

View File

@ -1190,13 +1190,16 @@ public class PlayerManager {
if (jPlayer == null || player.hasPermission("jobs.*"))
return;
int confMaxJobs = Jobs.getGCManager().getMaxJobs();
short playerMaxJobs = (short) jPlayer.progression.size();
int playerMaxJobs = getMaxJobs(jPlayer);
int playerCurrentJobs = jPlayer.progression.size();
if (confMaxJobs > 0 && playerMaxJobs >= confMaxJobs && !getJobsLimit(jPlayer, playerMaxJobs))
if (playerMaxJobs <= 0 || playerCurrentJobs >= playerMaxJobs)
return;
for (Job one : Jobs.getJobs()) {
if (jPlayer.progression.size() >= playerMaxJobs)
return;
if (one.getMaxSlots() != null && Jobs.getUsedSlots(one) >= one.getMaxSlots())
continue;

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ public class JobsConnection {
conn.close();
}
public synchronized Statement createStatement() throws SQLException {
public synchronized Statement createStatement() throws SQLException {
return conn.createStatement();
}

File diff suppressed because it is too large Load Diff