Skip to content

Commit

Permalink
Small Changes in Cactus Hammer
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelmehdiyev committed Nov 25, 2024
1 parent 96447d9 commit cdfad95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/net/rafael/usefulcactus/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ public class ModItems {
// Cactus Pickaxe: 4 attack damage, 1.2 attack speed
public static final Item CACTUS_PICKAXE = registerItem("cactus_pickaxe", new CactusPickaxeItem(
ModToolMaterial.CACTUS_SKIN, new Item.Settings().attributeModifiers(PickaxeItem.createAttributeModifiers(
ModToolMaterial.CACTUS_SKIN, 1, -2.0f))));
ModToolMaterial.CACTUS_SKIN, 1, -2.8f))));

// Cactus Axe: 9 attack damage, 0.8 attack speed
// Cactus Axe: 9 attack damage, 0.9 attack speed
public static final Item CACTUS_AXE = registerItem("cactus_axe", new AxeItem(
ModToolMaterial.CACTUS_SKIN, new Item.Settings().attributeModifiers(AxeItem.createAttributeModifiers(
ModToolMaterial.CACTUS_SKIN, 6, -3.2f))));
ModToolMaterial.CACTUS_SKIN, 6, -3.1f))));

// Cactus Shovel: 4.5 attack damage, 1.0 attack speed
public static final Item CACTUS_SHOVEL = registerItem("cactus_shovel", new ShovelItem(
ModToolMaterial.CACTUS_SKIN, new Item.Settings().attributeModifiers(ShovelItem.createAttributeModifiers(
ModToolMaterial.CACTUS_SKIN, 1.5f, -3.0f))));

// Cactus Hoe: 1 attack damage, 3.0 attack speed
// Cactus Hoe: 1 attack damage, 1.0 attack speed
public static final Item CACTUS_HOE = registerItem("cactus_hoe", new HoeItem(
ModToolMaterial.CACTUS_SKIN, new Item.Settings().attributeModifiers(HoeItem.createAttributeModifiers(
ModToolMaterial.CACTUS_SKIN, -2, -1.0f))));
ModToolMaterial.CACTUS_SKIN, -2, -3.0f))));

// Cactus Hammer: 8 attack damage, 0.8 attack speed
// Cactus Hammer: 12 attack damage, 0.9 attack speed
public static final Item CACTUS_HAMMER = registerItem("cactus_hammer", new CactusHammerItem(
ModToolMaterial.CACTUS_SKIN, new Item.Settings().attributeModifiers(PickaxeItem.createAttributeModifiers(
ModToolMaterial.CACTUS_SKIN, 5, -3.2f))));
ModToolMaterial.CACTUS_SKIN, 9, -3.1f))));

// Cactus Armor Items
public static final Item CACTUS_HELMET = registerItem("cactus_helmet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos block
ItemStack mainHandItem = player.getMainHandStack();

// Good pattern matching with instanceof
if (mainHandItem.getItem() instanceof CactusHammerItem hammer &&
if (mainHandItem.getItem() instanceof CactusHammerItem &&
player instanceof ServerPlayerEntity serverPlayer) {

// Recursion prevention
Expand Down

0 comments on commit cdfad95

Please sign in to comment.