Iterate through the durability damage with Unbreaking check

This commit is contained in:
TfT_02
2012-12-30 23:46:21 +01:00
parent 34027ee7c4
commit 3668249267
3 changed files with 15 additions and 13 deletions

View File

@ -504,9 +504,8 @@ public class WoodCutting {
private static int durabilityLossCalulate(ArrayList<Block> toBeFelled, int level) {
int durabilityLoss = 0;
for (Block x : toBeFelled) {
if (random.nextInt(level + 1) > 0) {}//Don't add durabilityLoss, because Unbreaking enchantment does it work.
if (random.nextInt(level + 1) > 0) {}//Don't add durabilityLoss, because Unbreaking enchantment does it's work.
else if (x.getType().equals(Material.LOG) || (Config.getInstance().getBlockModsEnabled() && ModChecks.isCustomLogBlock(x))) {
durabilityLoss++;
durabilityLoss = durabilityLoss + Config.getInstance().getAbilityToolDamage();
}
}