Skip to content

Commit

Permalink
allow disabling block-break pretesting
Browse files Browse the repository at this point in the history
  • Loading branch information
crashdemons committed Apr 1, 2020
1 parent 32d7634 commit df216dd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public enum configType {

put("ignoredheadnames", configType.UNVALIDATED_STRINGLIST);
put("ignoredheaduuids", configType.UUID_STRINGLIST);

put("pretestblockbreak", configType.BOOLEAN);
}
};
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
3 changes: 3 additions & 0 deletions PlayerHeads-core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit df216dd

Please sign in to comment.