diff --git a/src/main/java/com/atsuishio/superbwarfare/item/Hammer.java b/src/main/java/com/atsuishio/superbwarfare/item/Hammer.java index d5d2c3612..ec7826c47 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/Hammer.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/Hammer.java @@ -17,37 +17,39 @@ import org.jetbrains.annotations.NotNull; @EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME) public class Hammer extends SwordItem { + public static final Tier TIER = new Tier() { + public int getUses() { + return 400; + } + + public float getSpeed() { + return 4f; + } + + public float getAttackDamageBonus() { + return 8f; + } + + @Override + public @NotNull TagKey getIncorrectBlocksForDrops() { + return BlockTags.INCORRECT_FOR_IRON_TOOL; + } + + public int getLevel() { + return 1; + } + + public int getEnchantmentValue() { + return 9; + } + + public @NotNull Ingredient getRepairIngredient() { + return Ingredient.of(new ItemStack(Items.IRON_INGOT)); + } + }; + public Hammer() { - super(new Tier() { - public int getUses() { - return 400; - } - - public float getSpeed() { - return 4f; - } - - public float getAttackDamageBonus() { - return 8f; - } - - @Override - public @NotNull TagKey getIncorrectBlocksForDrops() { - return BlockTags.INCORRECT_FOR_IRON_TOOL; - } - - public int getLevel() { - return 1; - } - - public int getEnchantmentValue() { - return 9; - } - - public @NotNull Ingredient getRepairIngredient() { - return Ingredient.of(new ItemStack(Items.IRON_INGOT)); - } - }, new Properties()); + super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -3.2f)).stacksTo(1)); } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/item/Knife.java b/src/main/java/com/atsuishio/superbwarfare/item/Knife.java index 64757de4c..6e46cecc1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/Knife.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/Knife.java @@ -11,36 +11,39 @@ import net.minecraft.world.level.block.Block; import org.jetbrains.annotations.NotNull; public class Knife extends SwordItem { + + private static final Tier TIER = new Tier() { + public int getUses() { + return 1500; + } + + public float getSpeed() { + return 7f; + } + + public float getAttackDamageBonus() { + return 2.5f; + } + + @Override + public @NotNull TagKey getIncorrectBlocksForDrops() { + return BlockTags.INCORRECT_FOR_IRON_TOOL; + } + + public int getLevel() { + return 2; + } + + public int getEnchantmentValue() { + return 2; + } + + public @NotNull Ingredient getRepairIngredient() { + return Ingredient.of(new ItemStack(ModItems.STEEL_INGOT.get())); + } + }; + public Knife() { - super(new Tier() { - public int getUses() { - return 1500; - } - - public float getSpeed() { - return 7f; - } - - public float getAttackDamageBonus() { - return 2.5f; - } - - @Override - public @NotNull TagKey getIncorrectBlocksForDrops() { - return BlockTags.INCORRECT_FOR_IRON_TOOL; - } - - public int getLevel() { - return 2; - } - - public int getEnchantmentValue() { - return 2; - } - - public @NotNull Ingredient getRepairIngredient() { - return Ingredient.of(new ItemStack(ModItems.STEEL_INGOT.get())); - } - }, new Properties()); + super(TIER, new Properties().attributes(SwordItem.createAttributes(TIER, 3, -1.8f)).stacksTo(1)); } }