diff options
author | Linnea Gräf <nea@nea.moe> | 2025-04-01 01:37:55 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-04-01 01:37:55 +0200 |
commit | bda040c6c2cc77c9c1a06a61b2f13548d28d76ec (patch) | |
tree | 3c48dc96cfd74a6a7d167e45eaccca0bec74fb12 /src/main/kotlin/repo/ItemCache.kt | |
parent | 4f4652bb0d50dfd37297a573ad73ef9cd1a8e92d (diff) | |
download | Firmament-mc1.21.5.tar.gz Firmament-mc1.21.5.tar.bz2 Firmament-mc1.21.5.zip |
WIP: Port some 1.21.5 thingsmc1.21.5
Diffstat (limited to 'src/main/kotlin/repo/ItemCache.kt')
-rw-r--r-- | src/main/kotlin/repo/ItemCache.kt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/kotlin/repo/ItemCache.kt b/src/main/kotlin/repo/ItemCache.kt index 0967ad1..09eedac 100644 --- a/src/main/kotlin/repo/ItemCache.kt +++ b/src/main/kotlin/repo/ItemCache.kt @@ -4,7 +4,6 @@ import com.mojang.serialization.Dynamic import io.github.moulberry.repo.IReloadable import io.github.moulberry.repo.NEURepository import io.github.moulberry.repo.data.NEUItem -import io.github.notenoughupdates.moulconfig.xml.Bind import java.text.NumberFormat import java.util.UUID import java.util.concurrent.ConcurrentHashMap @@ -13,7 +12,6 @@ import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlin.jvm.optionals.getOrNull import net.minecraft.SharedConstants -import net.minecraft.client.resource.language.I18n import net.minecraft.component.DataComponentTypes import net.minecraft.component.type.NbtComponent import net.minecraft.datafixer.Schemas @@ -28,9 +26,6 @@ import net.minecraft.text.MutableText import net.minecraft.text.Style import net.minecraft.text.Text import moe.nea.firmament.Firmament -import moe.nea.firmament.gui.config.HudMeta -import moe.nea.firmament.gui.config.HudPosition -import moe.nea.firmament.gui.hud.MoulConfigHud import moe.nea.firmament.repo.RepoManager.initialize import moe.nea.firmament.util.LegacyFormattingCode import moe.nea.firmament.util.LegacyTagParser @@ -140,7 +135,8 @@ object ItemCache : IReloadable { ItemStack.fromNbt(MC.defaultRegistries, modernItemTag).getOrNull() ?: return brokenItemStack(this) itemInstance.loreAccordingToNbt = lore.map { un189Lore(it) } itemInstance.displayNameAccordingToNbt = un189Lore(displayName) - val extraAttributes = oldItemTag.getCompound("tag").getCompound("ExtraAttributes") + val extraAttributes = oldItemTag.getCompound("tag").flatMap { it.getCompound("ExtraAttributes") } + .getOrNull() if (extraAttributes != null) itemInstance.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(extraAttributes)) return itemInstance |