Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Theoness1 committed Jul 1, 2024
1 parent b6558fe commit c47d781
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ru.theone_ss.vanilla_claws.item.material.BaseToolMaterial;

public class WinterlyIntegration {
public static ToolMaterial CRYOMARBLE_MATERIAL = new BaseToolMaterial(521, 6.0F, 14, () -> Ingredient.ofItems(Registries.ITEM.get(Identifier.of("winterly", "cryomarble"))));
public static ToolMaterial CRYOMARBLE_MATERIAL = new BaseToolMaterial(551, 6.0F, 14, () -> Ingredient.ofItems(Registries.ITEM.get(Identifier.of("winterly", "cryomarble"))));

public static ToolMaterial getMaterial() {
return CRYOMARBLE_MATERIAL;
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/ru/theone_ss/vanilla_claws/item/ClawsItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.component.type.AttributeModifiersComponent;
import net.minecraft.component.type.ToolComponent;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.item.*;
Expand All @@ -23,9 +25,9 @@ public ClawsItem(ToolMaterial toolMaterial, Settings settings) {
private static ToolComponent createToolComponent() {
return new ToolComponent(
List.of(
ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), 15.0F),
ToolComponent.Rule.ofAlwaysDropping(List.of(Blocks.COBWEB), 22.0F),
ToolComponent.Rule.of(BlockTags.LEAVES, 15.0F),
ToolComponent.Rule.of(BlockTags.WOOL, 5.0F),
ToolComponent.Rule.of(BlockTags.WOOL, 8.0F),
ToolComponent.Rule.of(List.of(Blocks.VINE, Blocks.GLOW_LICHEN), 2.0F)
),
1.0F,
Expand Down Expand Up @@ -54,8 +56,18 @@ public static AttributeModifiersComponent createAttributeModifiers(int baseAttac
.build();
}

@Override
public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) {
return true;
}

@Override
public ActionResult useOnBlock(ItemUsageContext context) {
return Items.DIAMOND_HOE.useOnBlock(context);
}

@Override
public void postDamageEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) {
stack.damage(1, attacker, EquipmentSlot.MAINHAND);
}
}

0 comments on commit c47d781

Please sign in to comment.