aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-07-17 11:52:28 +0200
committerLinnea Gräf <nea@nea.moe>2025-07-17 11:52:28 +0200
commit25f0e7fd62db22036969120843165f4759530b8f (patch)
tree262ed44e0e68464ba99f7650fed8df102c982fe5 /src/main/kotlin/features/debug
parent13d64762bbf110fbc52719fb9d93490648199dd2 (diff)
downloadFirmament-25f0e7fd62db22036969120843165f4759530b8f.tar.gz
Firmament-25f0e7fd62db22036969120843165f4759530b8f.tar.bz2
Firmament-25f0e7fd62db22036969120843165f4759530b8f.zip
feat: Launch on 1.21.7
Diffstat (limited to 'src/main/kotlin/features/debug')
-rw-r--r--src/main/kotlin/features/debug/ExportedTestConstantMeta.kt2
-rw-r--r--src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt7
-rw-r--r--src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt2
3 files changed, 4 insertions, 7 deletions
diff --git a/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt b/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt
index f0250dc..bdc1f9a 100644
--- a/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt
+++ b/src/main/kotlin/features/debug/ExportedTestConstantMeta.kt
@@ -12,7 +12,7 @@ data class ExportedTestConstantMeta(
) {
companion object {
val current = ExportedTestConstantMeta(
- SharedConstants.getGameVersion().saveVersion.id,
+ SharedConstants.getGameVersion().dataVersion().id,
Optional.of("Firmament ${Firmament.version.friendlyString}")
)
diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt
index bc8c618..29a85d6 100644
--- a/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt
+++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemData.kt
@@ -1,15 +1,13 @@
package moe.nea.firmament.features.debug.itemeditor
import kotlinx.serialization.Serializable
-import kotlin.jvm.optionals.getOrNull
-import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
import net.minecraft.util.Identifier
import moe.nea.firmament.Firmament
import moe.nea.firmament.repo.ExpensiveItemCacheApi
import moe.nea.firmament.repo.ItemCache
-import moe.nea.firmament.util.MC
import moe.nea.firmament.util.StringUtil.camelWords
+import moe.nea.firmament.util.mc.loadItemFromNbt
/**
* Load data based on [prismarine.js' 1.8 item data](https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.8/items.json)
@@ -68,8 +66,7 @@ object LegacyItemData {
putByte("Count", 1)
putShort("Damage", legacyItemType.metadata)
})!!
- val stack = ItemStack.fromNbt(MC.defaultRegistries, nbt).getOrNull()
- ?: error("Could not transform ${legacyItemType}")
+ val stack = loadItemFromNbt(nbt) ?: error("Could not transform $legacyItemType")
stack.item to legacyItemType
}
}.toMap()
diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
index ecf3d2c..f4f23b0 100644
--- a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
@@ -284,7 +284,7 @@ class LegacyItemExporter private constructor(var itemStack: ItemStack) {
fun copyLegacySkullNbt() {
val profile = itemStack.get(DataComponentTypes.PROFILE) ?: return
legacyNbt.put("SkullOwner", NbtCompound().apply {
- profile.id.ifPresent {
+ profile.uuid.ifPresent {
putString("Id", it.toString())
}
putBoolean("hypixelPopulated", true)