1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-04 23:37:49 +01:00

Remove bossbar on server shutdown

This commit is contained in:
montlikadani 2019-08-15 09:41:25 +02:00
parent c164678273
commit 3ee52815a1
3 changed files with 4 additions and 4 deletions

View File

@ -752,6 +752,7 @@ public class Jobs extends JavaPlugin {
if (paymentThread != null)
paymentThread.shutdown();
Bukkit.getOnlinePlayers().forEach(p -> getPlayerManager().getJobsPlayer(p).clearBossMaps());
getPlayerManager().saveAll();
if (dao != null) {

View File

@ -202,11 +202,10 @@ public class PlayerManager {
if (jPlayer == null)
return;
jPlayer.onDisconnect();
if (Jobs.getGCManager().saveOnDisconnect()) {
jPlayer.onDisconnect();
jPlayer.save();
} else
jPlayer.onDisconnect();
}
}
/**

View File

@ -26,7 +26,6 @@ import java.util.Map.Entry;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import com.gamingmesh.jobs.Jobs;
@ -739,6 +738,7 @@ public class JobsPlayer {
public void clearBossMaps() {
for (BossBarInfo one : barMap) {
one.getBar().removeAll();
one.cancel();
}
barMap.clear();