From ecb9d8a95d407d0ac7c3d21004caabe37068b9c8 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 10 Aug 2024 01:39:07 +0700 Subject: [PATCH] update minecart item --- .../ru/dbotthepony/mc/otm/item/MinecartCargoCrateItem.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MinecartCargoCrateItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MinecartCargoCrateItem.kt index 25874fb54..435f59b86 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MinecartCargoCrateItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MinecartCargoCrateItem.kt @@ -1,6 +1,7 @@ package ru.dbotthepony.mc.otm.item import net.minecraft.core.Direction +import net.minecraft.core.component.DataComponents import net.minecraft.core.dispenser.BlockSource import net.minecraft.core.dispenser.DefaultDispenseItemBehavior import net.minecraft.core.dispenser.DispenseItemBehavior @@ -49,7 +50,7 @@ class MinecartCargoCrateItem(val color: DyeColor?) : MatteryItem(Properties().st val type = MEntityTypes.CARGO_CRATE_MINECARTS[color] ?: throw NullPointerException("Unable to find minecart entity type for color $color!") val entity = MinecartCargoCrate(type, color, level, blockpos.x.toDouble() + 0.5, blockpos.y.toDouble() + 0.0625 + d0, blockpos.z.toDouble() + 0.5) - if (itemstack.hasCustomHoverName()) { + if (itemstack.has(DataComponents.CUSTOM_NAME)) { entity.customName = itemstack.hoverName } @@ -107,7 +108,7 @@ class MinecartCargoCrateItem(val color: DyeColor?) : MatteryItem(Properties().st val entity = MinecartCargoCrate(type, color, level, x, y + d3, z) - if (itemStack.hasCustomHoverName()) { + if (itemStack.has(DataComponents.CUSTOM_NAME)) { entity.customName = itemStack.hoverName }