mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fix issue with custom axes not working with Tree Feller.
Most custom materials don't properly report their max durability, so we need to use our repairable manager to handle them instead.
This commit is contained in:
parent
2d3da6daf8
commit
6c478a26c4
@ -209,6 +209,7 @@ public final class Woodcutting {
|
|||||||
*/
|
*/
|
||||||
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
|
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
|
||||||
short durabilityLoss = 0;
|
short durabilityLoss = 0;
|
||||||
|
Material type = inHand.getType();
|
||||||
|
|
||||||
for (BlockState blockState : treeFellerBlocks) {
|
for (BlockState blockState : treeFellerBlocks) {
|
||||||
if (BlockUtils.isLog(blockState)) {
|
if (BlockUtils.isLog(blockState)) {
|
||||||
@ -217,7 +218,7 @@ public final class Woodcutting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkillUtils.handleDurabilityChange(inHand, durabilityLoss);
|
SkillUtils.handleDurabilityChange(inHand, durabilityLoss);
|
||||||
return (inHand.getDurability() < inHand.getType().getMaxDurability());
|
return (inHand.getDurability() < (mcMMO.getRepairableManager().isRepairable(type) ? mcMMO.getRepairableManager().getRepairable(type).getMaximumDurability() : type.getMaxDurability()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user