aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-04-26 18:04:45 +0200
committerLinnea Gräf <nea@nea.moe>2024-04-26 18:15:54 +0200
commit7e0151569477df63601be50c82177ecfd21e5deb (patch)
treef30e5440a1855de92d2b424ef79339d3d6cf5f34 /src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt
parent041da7c7d179df01c4048a81ddf40a9f13c3ce77 (diff)
downloadFirmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.gz
Firmament-7e0151569477df63601be50c82177ecfd21e5deb.tar.bz2
Firmament-7e0151569477df63601be50c82177ecfd21e5deb.zip
Bump to 1.20.5
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt')
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt b/src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt
index e438f59..261b8f5 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/entity/ModifyEquipment.kt
@@ -7,9 +7,11 @@
package moe.nea.firmament.gui.entity
import com.google.gson.JsonObject
+import net.minecraft.component.DataComponentTypes
+import net.minecraft.component.type.DyedColorComponent
import net.minecraft.entity.EquipmentSlot
import net.minecraft.entity.LivingEntity
-import net.minecraft.item.DyeableArmorItem
+import net.minecraft.item.ArmorItem
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.item.Items
@@ -51,9 +53,8 @@ object ModifyEquipment : EntityModifier {
}
private fun coloredLeatherArmor(leatherArmor: Item, data: String): ItemStack {
- require(leatherArmor is DyeableArmorItem)
val stack = ItemStack(leatherArmor)
- leatherArmor.setColor(stack, data.toInt(16))
+ stack.set(DataComponentTypes.DYED_COLOR, DyedColorComponent(data.toInt(16), false))
return stack
}
}