diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 6ddf80cc..afcd52d6 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -692,14 +692,13 @@ public class Jobs extends JavaPlugin { * Executes clean shutdown */ public static void shutdown() { - //Bukkit.getOnlinePlayers().forEach(p -> getPlayerManager().getJobsPlayer(p).clearBossMaps()); - if (saveTask != null) saveTask.shutdown(); if (paymentThread != null) paymentThread.shutdown(); + getPlayerManager().removePlayerAdditions(); getPlayerManager().saveAll(); if (dao != null) { diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index de7bf4f7..0c4b6e93 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -222,6 +222,13 @@ public class PlayerManager { } } + public void removePlayerAdditions() { + for (JobsPlayer jPlayer : players.values()) { + jPlayer.clearBossMaps(); + jPlayer.clearUpdateBossBarFor(); + } + } + /** * Save all the information of all of the players in the game */ diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 6487ed14..15bf1661 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -784,11 +784,8 @@ public class ConfigManager { GUIitem = CMIMaterial.PLAYER_HEAD.newItemStack(); SkullMeta skullMeta = (SkullMeta) GUIitem.getItemMeta(); if (skullOwner.length() == 36) { - try { - OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(skullOwner)); - skullMeta.setOwner(offPlayer.getName()); - } catch (IllegalArgumentException e) { - } + OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(skullOwner)); + skullMeta.setOwner(offPlayer.getName()); } else skullMeta.setOwner(skullOwner); GUIitem.setItemMeta(skullMeta); @@ -810,11 +807,8 @@ public class ConfigManager { GUIitem = CMIMaterial.PLAYER_HEAD.newItemStack(); SkullMeta skullMeta = (SkullMeta) GUIitem.getItemMeta(); if (skullOwner.length() == 36) { - try { - OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(skullOwner)); - skullMeta.setOwner(offPlayer.getName()); - } catch (IllegalArgumentException e) { - } + OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(UUID.fromString(skullOwner)); + skullMeta.setOwner(offPlayer.getName()); } else skullMeta.setOwner(skullOwner); GUIitem.setItemMeta(skullMeta); diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index 34b73bc2..6f2101e5 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -299,7 +299,7 @@ public class LanguageManager { c.get("command.shop.info.currentPoints", "&eYou have: &6%currentpoints%"); c.get("command.shop.info.price", "&ePrice: &6%price%"); c.get("command.shop.info.reqJobs", "&eRequired jobs:"); - c.get("command.shop.info.reqJobsList", " &e%jobsname%&e: &e%level% lvl"); + c.get("command.shop.info.reqJobsList", " &6%jobsname%&e: &e%level% lvl"); c.get("command.shop.info.reqTotalLevel", "&6Required total level: &e%totalLevel%"); c.get("command.shop.info.reqJobsColor", "&4"); c.get("command.shop.info.reqJobsLevelColor", "&4"); diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index c58eae54..301f319f 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -199,12 +199,8 @@ public class ShopManager { if (item.isHeadOwner()) skullMeta.setOwner(Jobs.getPlayerManager().getJobsPlayer(player).getName()); else { - try { - OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(item.getCustomHead()); - skullMeta.setOwner(offPlayer.getName()); - } catch (Exception e) { - e.printStackTrace(); - } + OfflinePlayer offPlayer = Bukkit.getOfflinePlayer(item.getCustomHead()); + skullMeta.setOwner(offPlayer.getName()); } GUIitem.setItemMeta(skullMeta); } else