diff --git a/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/entities/components/SetEntityType.kt b/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/entities/components/SetEntityType.kt index fa63158..6111880 100644 --- a/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/entities/components/SetEntityType.kt +++ b/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/entities/components/SetEntityType.kt @@ -3,18 +3,14 @@ package com.mineinabyss.geary.papermc.tracking.entities.components import com.mineinabyss.idofront.nms.aliases.NMSEntityType import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -import kotlinx.serialization.Transient import net.minecraft.world.entity.EntityType +@JvmInline @Serializable @SerialName("geary:set.entity_type") -class SetEntityType( - private val key: String, - // TODO support this via custom entity types in the future -// val mobCategory: MobCategory? = null, -) { - @Transient - val entityTypeFromRegistry: EntityType<*> = NMSEntityType - .byString(key) - .orElseGet { error("An entity type with key $key was not found.") } +value class SetEntityType(val key: String) { + val entityTypeFromRegistry: EntityType<*> + get() = NMSEntityType + .byString(key) + .orElseGet { error("An entity type with key $key was not found.") } } diff --git a/gradle.properties b/gradle.properties index 38c95cc..04146fb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,4 @@ kotlin.code.style=official group=com.mineinabyss version=0.28 idofrontVersion=0.20.14 -gearyVersion=0.24.1 +gearyVersion=0.24.2