step 1. add a component

This commit is contained in:
YuRaNnNzZZ 2024-09-29 23:55:40 +03:00
parent 1ae3be6499
commit 5ea1b5d004
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D

View File

@ -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)
}