Skip to content

Commit

Permalink
fixed axes not breaking leaves
Browse files Browse the repository at this point in the history
closes #375
  • Loading branch information
Ellpeck committed Dec 5, 2024
1 parent fd52a3a commit a847abd
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
public class ItemAxe extends AxeItem implements IModItem, ICustomItemModel {

private final String baseName;
private final float defaultSpeed;

public ItemAxe(String baseName, Tier material, float damage, float speed) {
super(material, new Properties().attributes(AxeItem.createAttributes(material, damage, speed)));
this.baseName = baseName;
this.defaultSpeed = speed;
ModRegistry.ALL_ITEMS.add(this);
}

Expand All @@ -38,7 +36,7 @@ public String getBaseName() {
@Override
public float getDestroySpeed(ItemStack stack, BlockState state) {
if (state.is(BlockTags.LEAVES)) {
return this.defaultSpeed;
return this.getTier().getSpeed();
} else {
return super.getDestroySpeed(stack, state);
}
Expand Down

0 comments on commit a847abd

Please sign in to comment.