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:
parent
c164678273
commit
3ee52815a1
@ -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) {
|
||||
|
@ -202,11 +202,10 @@ public class PlayerManager {
|
||||
if (jPlayer == null)
|
||||
return;
|
||||
|
||||
jPlayer.onDisconnect();
|
||||
if (Jobs.getGCManager().saveOnDisconnect()) {
|
||||
jPlayer.onDisconnect();
|
||||
jPlayer.save();
|
||||
} else
|
||||
jPlayer.onDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user