aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/features/debug/itemeditor
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-11-15 23:13:50 +0100
committerLinnea Gräf <nea@nea.moe>2025-11-15 23:13:50 +0100
commit4d8399ff4d769def62e6a8241327c4f2dac47e71 (patch)
tree703f8651cb680d2583d82c2b1b4aee0911ccb490 /src/main/kotlin/features/debug/itemeditor
parent215178c650d38a4a77fdef6dc8815c07bef29c25 (diff)
downloadFirmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.gz
Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.tar.bz2
Firmament-4d8399ff4d769def62e6a8241327c4f2dac47e71.zip
snapshot: main source set compile
Diffstat (limited to 'src/main/kotlin/features/debug/itemeditor')
-rw-r--r--src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt3
-rw-r--r--src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt b/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt
index 9356dd3..b3dc69a 100644
--- a/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt
+++ b/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt
@@ -6,6 +6,7 @@ import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
import net.minecraft.client.network.AbstractClientPlayerEntity
import net.minecraft.entity.decoration.ArmorStandEntity
+import net.minecraft.util.AssetInfo
import moe.nea.firmament.Firmament
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.events.HandledScreenKeyPressedEvent
@@ -67,7 +68,7 @@ object ExportRecipe {
val id = generateName(reply)
ItemExporter.exportStub(id, "§9$reply") {
val playerEntity = entity as? AbstractClientPlayerEntity
- val textureUrl = playerEntity?.skinTextures?.textureUrl
+ val textureUrl = (playerEntity?.skin?.body as? AssetInfo.SkinAssetInfo)?.url
if (textureUrl != null)
it.setSkullOwner(playerEntity.uuid, textureUrl)
}
diff --git a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
index f06eb43..65f9fa1 100644
--- a/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
+++ b/src/main/kotlin/features/debug/itemeditor/LegacyItemExporter.kt
@@ -291,12 +291,10 @@ class LegacyItemExporter private constructor(var itemStack: ItemStack) {
fun copyLegacySkullNbt() {
val profile = itemStack.get(DataComponentTypes.PROFILE) ?: return
legacyNbt.put("SkullOwner", NbtCompound().apply {
- profile.uuid.ifPresent {
- putString("Id", it.toString())
- }
+ putString("Id", profile.gameProfile.id.toString())
putBoolean("hypixelPopulated", true)
put("Properties", NbtCompound().apply {
- profile.properties().forEach { prop, value ->
+ profile.gameProfile.properties().forEach { prop, value ->
val list = getListOrEmpty(prop)
put(prop, list)
list.add(NbtCompound().apply {