BossBars are no longer supported in 1.12 due to api restrictions

This commit is contained in:
libraryaddict
2020-04-07 14:08:17 +12:00
parent dc2a1a23a0
commit a2262860d5
5 changed files with 30 additions and 15 deletions

View File

@@ -967,17 +967,19 @@ public class DisguiseUtilities {
registerNoName(board);
}
Iterator<KeyedBossBar> bars = Bukkit.getBossBars();
ArrayList<KeyedBossBar> barList = new ArrayList<>();
bars.forEachRemaining(barList::add);
if (NmsVersion.v1_13.isSupported()) {
Iterator<KeyedBossBar> bars = Bukkit.getBossBars();
ArrayList<KeyedBossBar> barList = new ArrayList<>();
bars.forEachRemaining(barList::add);
for (KeyedBossBar bar : barList) {
if (!bar.getKey().getNamespace().equalsIgnoreCase("libsdisguises")) {
continue;
for (KeyedBossBar bar : barList) {
if (!bar.getKey().getNamespace().equalsIgnoreCase("libsdisguises")) {
continue;
}
bar.removeAll();
Bukkit.removeBossBar(bar.getKey());
}
bar.removeAll();
Bukkit.removeBossBar(bar.getKey());
}
}