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:
parent
fd3c420f08
commit
bf06440811
@ -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
@ -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
Loading…
Reference in New Issue
Block a user