diff options
Diffstat (limited to 'bukkit')
| -rw-r--r-- | bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/bossbar/BossBar_Bukkit.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/bossbar/BossBar_Bukkit.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/bossbar/BossBar_Bukkit.java index 2431abd8..1aa5268e 100644 --- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/bossbar/BossBar_Bukkit.java +++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/hook/bossbar/BossBar_Bukkit.java @@ -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()) { |
