mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Remove bossbar on server shutdown
This commit is contained in:
parent
e6a128d876
commit
066c0dd2b6
@ -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) {
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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) {
|
||||
}
|
||||
} 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) {
|
||||
}
|
||||
} else
|
||||
skullMeta.setOwner(skullOwner);
|
||||
GUIitem.setItemMeta(skullMeta);
|
||||
|
@ -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");
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
GUIitem.setItemMeta(skullMeta);
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user