mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 13:46:46 +01:00
This does prevent using wood axes everytime you tree fell
This commit is contained in:
parent
cc18794a93
commit
00279502e4
@ -84,6 +84,8 @@ public class WoodCutting {
|
|||||||
if (health >= 2) {
|
if (health >= 2) {
|
||||||
Combat.dealDamage(player, random.nextInt(health - 1));
|
Combat.dealDamage(player, random.nextInt(health - 1));
|
||||||
}
|
}
|
||||||
|
inHand.setDurability((short) (inHand.getType().getMaxDurability()));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) {
|
else if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) {
|
||||||
@ -94,11 +96,12 @@ public class WoodCutting {
|
|||||||
if (health >= 2) {
|
if (health >= 2) {
|
||||||
Combat.dealDamage(player, random.nextInt(health - 1));
|
Combat.dealDamage(player, random.nextInt(health - 1));
|
||||||
}
|
}
|
||||||
|
inHand.setDurability((short) (inHand.getType().getMaxDurability()));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Damage the tool */
|
/* Damage the tool */
|
||||||
if (inHand.getDurability() + durabilityLoss > inHand.getType().getMaxDurability()) inHand.setDurability((short) (inHand.getType().getMaxDurability()));
|
inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
|
||||||
else inHand.setDurability((short) (inHand.getDurability() + durabilityLoss));
|
|
||||||
|
|
||||||
//Prepare ItemStacks
|
//Prepare ItemStacks
|
||||||
ItemStack item = null;
|
ItemStack item = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user