mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-24 14:16:44 +01:00
feat: introduce a flag section into the config for instabreak (#4368)
* Added and applied config * removed wrong return logic
This commit is contained in:
parent
5344efd1b7
commit
25e98618b9
@ -670,7 +670,11 @@ public class BlockEventListener implements Listener {
|
|||||||
BlockBreakEvent call = new BlockBreakEvent(block, player);
|
BlockBreakEvent call = new BlockBreakEvent(block, player);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(call);
|
Bukkit.getServer().getPluginManager().callEvent(call);
|
||||||
if (!call.isCancelled()) {
|
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
|
// == rather than <= as we only care about the "ground level" not being destroyed
|
||||||
|
@ -723,6 +723,12 @@ public class Settings extends Config {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Comment("Settings related to flags")
|
||||||
|
public static final class Flags {
|
||||||
|
|
||||||
|
@Comment("If \"instabreak\" should consider the used tool.")
|
||||||
|
public static boolean INSTABREAK_CONSIDER_TOOL = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Comment({"Enable or disable parts of the plugin",
|
@Comment({"Enable or disable parts of the plugin",
|
||||||
"Note: A cache will use some memory if enabled"})
|
"Note: A cache will use some memory if enabled"})
|
||||||
|
Loading…
Reference in New Issue
Block a user