diff --git a/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/Config.java b/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/Config.java index 12656a71..fe85871d 100644 --- a/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/Config.java +++ b/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/Config.java @@ -95,6 +95,8 @@ public enum configType { put("ignoredheadnames", configType.UNVALIDATED_STRINGLIST); put("ignoredheaduuids", configType.UUID_STRINGLIST); + + put("pretestblockbreak", configType.BOOLEAN); } }; /** diff --git a/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/PlayerHeadsListener.java b/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/PlayerHeadsListener.java index f7454cfb..da32216b 100644 --- a/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/PlayerHeadsListener.java +++ b/PlayerHeads-core/src/main/java/org/shininet/bukkit/playerheads/PlayerHeadsListener.java @@ -559,7 +559,7 @@ private BlockDropResult blockDrop(BlockEvent event, Block block, BlockState stat * * @param event the event received */ - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled=true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) public void onBlockBreak(BlockBreakEvent event) { if (event instanceof SimulatedBlockBreakEvent) { return; @@ -573,7 +573,8 @@ public void onBlockBreak(BlockBreakEvent event) { if (skullType != null) { boolean canBreak = true; - if (CompatiblePlugins.isReady()) { + boolean pretestblockbreak = plugin.getConfig().getBoolean("pretestblockbreak"); + if (pretestblockbreak && CompatiblePlugins.isReady()) { canBreak = CompatiblePlugins.testBlockBreak(block, player); } diff --git a/PlayerHeads-core/src/main/resources/config.yml b/PlayerHeads-core/src/main/resources/config.yml index ab8feda2..9adfd0eb 100644 --- a/PlayerHeads-core/src/main/resources/config.yml +++ b/PlayerHeads-core/src/main/resources/config.yml @@ -129,6 +129,9 @@ considertameowner: false ignoredheadnames: [CSCoreLib,CsCoreLib,CS-CoreLib] ignoredheaduuids: [] +#control whether PlayerHeads checks for block-break protection before dropping (necessary for accurate results under NoCheatPlus) +pretestblockbreak: true + #modifier for the rate of drops from different sizes of slime/magma cubes. #for instance, 1.0 means that the slime drops 100% of the slimedroprate.