feat: introduce a flag section into the config for instabreak (#4368)

* Added and applied config

* removed wrong return logic
This commit is contained in:
Maurice
2024-03-07 21:34:25 +01:00
committed by GitHub
parent 5344efd1b7
commit 25e98618b9
2 changed files with 11 additions and 1 deletions

View File

@ -670,7 +670,11 @@ public class BlockEventListener implements Listener {
BlockBreakEvent call = new BlockBreakEvent(block, player);
Bukkit.getServer().getPluginManager().callEvent(call);
if (!call.isCancelled()) {
event.getBlock().breakNaturally();
if (Settings.Flags.INSTABREAK_CONSIDER_TOOL) {
block.breakNaturally(event.getItemInHand());
} else {
block.breakNaturally();
}
}
}
// == rather than <= as we only care about the "ground level" not being destroyed