diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 645ab239..96b9a2ef 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -749,7 +749,7 @@ public class Jobs extends JavaPlugin { ToggleBarHandling.load(); usedSlots.clear(); for (Job job : jobs) { - usedSlots.put(job, getDBManager().getDB().getSlotsTaken(job)); + usedSlots.put(job, dao.getSlotsTaken(job)); } getPlayerManager().reload(); getPermissionHandler().registerPermissions(); @@ -764,7 +764,7 @@ public class Jobs extends JavaPlugin { paymentThread = new BufferedPaymentThread(getGCManager().getEconomyBatchDelay()); paymentThread.start(); - getDBManager().getDB().loadPlayerData(); + dao.loadPlayerData(); // Schedule if (getGCManager().enableSchedule) { diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 577a1d29..cce91117 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -650,7 +650,9 @@ public abstract class JobsDAO { while (res.next()) { int id = res.getInt(JobsTableFields.userid.getCollumn()); String jobName = res.getString(JobsTableFields.job.getCollumn()); - List ls = new ArrayList<>(); + List ls = map.get(id); + if (ls == null) + ls = new ArrayList<>(); int jobId = res.getInt(JobsTableFields.jobid.getCollumn()); if (jobId == 0) { @@ -662,7 +664,7 @@ public abstract class JobsDAO { if (jobName == null || jobName.isEmpty()) converted = false; - Job job = Jobs.getJob(jobName); + Job job = Jobs.getJob(jobId); if (job != null) ls.add(new JobsDAOData(job.getName(), res.getInt(JobsTableFields.level.getCollumn()), res.getDouble(JobsTableFields.experience.getCollumn()))); }