From 5ea1b5d0043429c2a665ce21e0c3779cf4ceb2e5 Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Sun, 29 Sep 2024 23:55:40 +0300 Subject: [PATCH] step 1. add a component --- src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt index 26b0dd0fe..77e9ccf3c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt @@ -1,6 +1,7 @@ package ru.dbotthepony.mc.otm.registry +import net.minecraft.core.component.DataComponents import net.minecraft.core.registries.BuiltInRegistries import net.minecraft.tags.BlockTags import net.minecraft.world.food.FoodProperties @@ -350,7 +351,8 @@ object MItems { Properties().attributes(ShovelItem.createAttributes(TRITANIUM_COMPONENT, 0f, -3.4f))) } - val TRITANIUM_SHEARS: ShearsItem by registry.register(MNames.TRITANIUM_SHEARS) { object : ShearsItem(Properties().durability(3072)) { + val TRITANIUM_SHEARS: ShearsItem by registry.register(MNames.TRITANIUM_SHEARS) { object : ShearsItem( + Properties().durability(3072).component(DataComponents.TOOL, createToolProperties())) { override fun isValidRepairItem(pToRepair: ItemStack, pRepair: ItemStack): Boolean { return pRepair.`is`(MItemTags.TRITANIUM_INGOTS) }