Skip to content

Commit d07200c

Browse files
committed
Fix for #437 boss bar flag was named wrongly
1 parent b39ca21 commit d07200c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/world/bentobox/aoneblock/AOneBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class AOneBlock extends GameModeAddon {
6767
.defaultSetting(false)
6868
.build();
6969
private BossBarListener bossBar = new BossBarListener(this);
70-
public final Flag BOSSBAR = new Flag.Builder("BOSSBAR", Material.DRAGON_HEAD).mode(Mode.BASIC)
70+
public final Flag ONEBLOCK_BOSSBAR = new Flag.Builder("ONEBLOCK_BOSSBAR", Material.DRAGON_HEAD).mode(Mode.BASIC)
7171
.type(Type.SETTING).listener(bossBar).defaultSetting(true).build();
7272

7373
@Override
@@ -93,7 +93,7 @@ public void onLoad() {
9393
// Register protection flag with BentoBox
9494
getPlugin().getFlagsManager().registerFlag(this, START_SAFETY);
9595
// Bossbar
96-
getPlugin().getFlagsManager().registerFlag(this, this.BOSSBAR);
96+
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_BOSSBAR);
9797
}
9898
}
9999

src/main/java/world/bentobox/aoneblock/commands/island/IslandBossBarCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void setup() {
2828
public boolean execute(User user, String label, List<String> args) {
2929
addon.getBossBar().toggleUser(user);
3030
getIslands().getIslandAt(user.getLocation()).ifPresent(i -> {
31-
if (!i.isAllowed(addon.BOSSBAR)) {
31+
if (!i.isAllowed(addon.ONEBLOCK_BOSSBAR)) {
3232
user.sendMessage("aoneblock.bossbar.not-active");
3333
}
3434
});

src/main/java/world/bentobox/aoneblock/listeners/BossBarListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void onEnterIsland(IslandEnterEvent event) {
5656

5757
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
5858
public void onFlagChange(FlagSettingChangeEvent e) {
59-
if (e.getEditedFlag() == addon.BOSSBAR) {
59+
if (e.getEditedFlag() == addon.ONEBLOCK_BOSSBAR) {
6060
// Show to players on island. If it isn't allowed then this will clean up the boss bar too
6161
e.getIsland().getPlayersOnIsland().stream().map(Player::getUniqueId)
6262
.forEach(uuid -> this.tryToShowBossBar(uuid, e.getIsland()));
@@ -72,7 +72,7 @@ private void tryToShowBossBar(UUID uuid, Island island) {
7272
User user = User.getInstance(uuid);
7373

7474
// Only show if enabled for island
75-
if (!island.isAllowed(addon.BOSSBAR)) {
75+
if (!island.isAllowed(addon.ONEBLOCK_BOSSBAR)) {
7676
BossBar removed = islandBossBars.remove(island);
7777
if (removed != null) {
7878
// Remove all players from the boss bar

0 commit comments

Comments
 (0)