Hammers fix

This commit is contained in:
Aleksey 2020-10-19 09:33:42 +03:00
parent f80ed2d1e8
commit ad1c9d7d7a
4 changed files with 28 additions and 7 deletions

View file

@ -1,6 +1,7 @@
package ru.betterend.item;
import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.AxeItem;
@ -17,6 +18,9 @@ public class EndAxe extends AxeItem implements DynamicAttributeTool {
@Override
public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
return this.getMaterial().getMiningLevel();
if (tag.equals(FabricToolTags.AXES)) {
return this.getMaterial().getMiningLevel();
}
return 0;
}
}