feat(hamster-chain-break): 树叶不计入耐久度
This commit is contained in:
@@ -62,11 +62,17 @@ public final class MainListener implements Listener {
|
|||||||
}
|
}
|
||||||
short maxDurability = stack.getType().getMaxDurability();
|
short maxDurability = stack.getType().getMaxDurability();
|
||||||
short durability = stack.getDurability();
|
short durability = stack.getDurability();
|
||||||
|
if (durability >= maxDurability) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (Block block : resultBlocks) {
|
for (Block block : resultBlocks) {
|
||||||
|
boolean leaves = block.getType().name().endsWith("_LEAVES");
|
||||||
if (block.breakNaturally(stack)) {
|
if (block.breakNaturally(stack)) {
|
||||||
durability++;
|
if (!leaves) {
|
||||||
if (durability >= maxDurability) {
|
durability++;
|
||||||
break;
|
if (durability >= maxDurability) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user