Skip to content

Commit 811641f

Browse files
committed
Fixes boss bar being one off for mined blocks
Incrementing was happening after the event was called instead before so the first block was not being counted. #426
1 parent 0c48aa6 commit 811641f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ private void process(@NonNull Cancellable e, @NonNull Island i, @Nullable Player
363363
return;
364364
}
365365

366+
// Increment the block number
367+
is.incrementBlockNumber();
368+
366369
// Break the block
367370
if (e instanceof BlockBreakEvent) {
368371
this.breakBlock(player, block, nextBlock, i);
@@ -381,8 +384,6 @@ private void process(@NonNull Cancellable e, @NonNull Island i, @Nullable Player
381384
Bukkit.getPluginManager().callEvent(new MagicBlockEvent(i, null, null, block, nextBlock.getMaterial()));
382385
}
383386

384-
// Increment the block number
385-
is.incrementBlockNumber();
386387
}
387388

388389
private OneBlockPhase handleGoto(OneBlockIslands is, int gotoBlock) {

0 commit comments

Comments
 (0)