mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-08 01:08:23 +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)
|
if (paymentThread != null)
|
||||||
paymentThread.shutdown();
|
paymentThread.shutdown();
|
||||||
|
|
||||||
|
Bukkit.getOnlinePlayers().forEach(p -> getPlayerManager().getJobsPlayer(p).clearBossMaps());
|
||||||
getPlayerManager().saveAll();
|
getPlayerManager().saveAll();
|
||||||
|
|
||||||
if (dao != null) {
|
if (dao != null) {
|
||||||
|
@ -202,11 +202,10 @@ public class PlayerManager {
|
|||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
jPlayer.onDisconnect();
|
||||||
if (Jobs.getGCManager().saveOnDisconnect()) {
|
if (Jobs.getGCManager().saveOnDisconnect()) {
|
||||||
jPlayer.onDisconnect();
|
|
||||||
jPlayer.save();
|
jPlayer.save();
|
||||||
} else
|
}
|
||||||
jPlayer.onDisconnect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,7 +26,6 @@ import java.util.Map.Entry;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.block.Block;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
@ -739,6 +738,7 @@ public class JobsPlayer {
|
|||||||
|
|
||||||
public void clearBossMaps() {
|
public void clearBossMaps() {
|
||||||
for (BossBarInfo one : barMap) {
|
for (BossBarInfo one : barMap) {
|
||||||
|
one.getBar().removeAll();
|
||||||
one.cancel();
|
one.cancel();
|
||||||
}
|
}
|
||||||
barMap.clear();
|
barMap.clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user