Skip to content

Commit

Permalink
Fix RepairFriendly configuration option not working (fixes #117)
Browse files Browse the repository at this point in the history
  • Loading branch information
2008Choco committed Aug 27, 2024
1 parent 9e438a7 commit 2da584e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ private void onBlockBreak(BlockBreakEvent event) {
hooks.forEach(h -> h.exempt(player));

// Actually destroying the allocated blocks
int maxDurability = item.getType().getMaxDurability() - (category.getConfiguration().isRepairFriendly() ? 1 : 0);
int maxDurability = item.getType().getMaxDurability();
if (category.getConfiguration().isRepairFriendly()) {
maxDurability -= 2; // Make sure tools still have enough durability to mine the current block AND other blocks in the vein
}

float hungerModifier = plugin.getConfiguration().getHungerModifier() * 0.025F;
int minimumFoodLevel = plugin.getConfiguration().getMinimumFoodLevel();

Expand Down

0 comments on commit 2da584e

Please sign in to comment.