diff --git a/pom.xml b/pom.xml index 94d60ab..58c949a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ site.deercloud LiteWorldEdit - 1.3-SNAPSHOT + 1.4-SNAPSHOT jar LiteWorldEdit diff --git a/src/main/java/site/deercloud/liteworldedit/Managers/Cache.java b/src/main/java/site/deercloud/liteworldedit/Managers/Cache.java index 91397f4..e32fd22 100644 --- a/src/main/java/site/deercloud/liteworldedit/Managers/Cache.java +++ b/src/main/java/site/deercloud/liteworldedit/Managers/Cache.java @@ -50,6 +50,7 @@ public class Cache { return null; } if (_jobs.get(player).isEmpty()) { + _jobs.remove(player); return null; } Job job = _jobs.get(player).pop(); @@ -88,17 +89,20 @@ public class Cache { return null; } if (_last_jobs_player == null) { - return _jobs.keySet().iterator().next(); + _last_jobs_player = _jobs.keySet().iterator().next(); + return _last_jobs_player; } boolean found = false; for (String key : _jobs.keySet()) { if (found) { + _last_jobs_player = key; return key; } if (key.equals(_last_jobs_player)) { found = true; } } - return _jobs.keySet().iterator().next(); + _last_jobs_player = _jobs.keySet().iterator().next(); + return _last_jobs_player; } }