Skip to content

Commit

Permalink
Fix not deleted bossbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Elikill58 authored and LMBishop committed Sep 18, 2023
1 parent 953ca7e commit 93e7821
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -19,6 +19,13 @@ public class BossBar_Bukkit implements BossBar {

public BossBar_Bukkit(BukkitQuestsPlugin plugin) {
this.plugin = plugin;
String pluginNamespace = new NamespacedKey(plugin, "test").getNamespace(); // get namespace
Lists.newArrayList(Bukkit.getBossBars()).forEach(bb -> { // copy list to prevent current modification
if(bb.getKey().namespace().equals(pluginNamespace)) {
bb.removeAll(); // hide it
Bukkit.removeBossBar(bb.getKey()); // remove it
}
});
plugin.getScheduler().runTaskTimer(() -> {
for (Entry<NamespacedKey, Long> entry : new HashMap<>(players).entrySet()) {
if (entry.getValue() < System.currentTimeMillis()) {
Expand Down

0 comments on commit 93e7821

Please sign in to comment.