修复武器属性

This commit is contained in:
17146 2025-04-08 22:53:20 +08:00
parent 5c62b01b6c
commit 2a706e94d3
2 changed files with 65 additions and 60 deletions

View file

@ -17,8 +17,7 @@ import org.jetbrains.annotations.NotNull;
@EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME)
public class Hammer extends SwordItem {
public Hammer() {
super(new Tier() {
public static final Tier TIER = new Tier() {
public int getUses() {
return 400;
}
@ -47,7 +46,10 @@ public class Hammer extends SwordItem {
public @NotNull Ingredient getRepairIngredient() {
return Ingredient.of(new ItemStack(Items.IRON_INGOT));
}
}, new Properties());
};
public Hammer() {
super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -3.2f)).stacksTo(1));
}
@Override

View file

@ -11,8 +11,8 @@ import net.minecraft.world.level.block.Block;
import org.jetbrains.annotations.NotNull;
public class Knife extends SwordItem {
public Knife() {
super(new Tier() {
private static final Tier TIER = new Tier() {
public int getUses() {
return 1500;
}
@ -41,6 +41,9 @@ public class Knife extends SwordItem {
public @NotNull Ingredient getRepairIngredient() {
return Ingredient.of(new ItemStack(ModItems.STEEL_INGOT.get()));
}
}, new Properties());
};
public Knife() {
super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -1.8f)).stacksTo(1));
}
}