From 446e7a9534245e656db8e8391a1343e64e82ef1c Mon Sep 17 00:00:00 2001 From: Will FP Date: Sun, 10 Mar 2024 17:03:51 +0000 Subject: [PATCH] Fixed ExtendedPersistentDataContainerFactory on 1.20.4 --- eco-core/core-nms/v1_20_R3/build.gradle.kts | 2 +- .../v1_20_R3/ExtendedPersistentDataContainerFactory.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eco-core/core-nms/v1_20_R3/build.gradle.kts b/eco-core/core-nms/v1_20_R3/build.gradle.kts index fbc421375..d10e0a8ef 100644 --- a/eco-core/core-nms/v1_20_R3/build.gradle.kts +++ b/eco-core/core-nms/v1_20_R3/build.gradle.kts @@ -7,7 +7,7 @@ version = rootProject.version dependencies { implementation(project(":eco-core:core-nms:nms-common")) - paperweight.paperDevBundle("1.20.3-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT") implementation("net.kyori:adventure-text-minimessage:4.11.0") { version { diff --git a/eco-core/core-nms/v1_20_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_20_R3/ExtendedPersistentDataContainerFactory.kt b/eco-core/core-nms/v1_20_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_20_R3/ExtendedPersistentDataContainerFactory.kt index fe688996a..a3bea877c 100644 --- a/eco-core/core-nms/v1_20_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_20_R3/ExtendedPersistentDataContainerFactory.kt +++ b/eco-core/core-nms/v1_20_R3/src/main/kotlin/com/willfp/eco/internal/spigot/proxy/v1_20_R3/ExtendedPersistentDataContainerFactory.kt @@ -46,17 +46,17 @@ class ExtendedPersistentDataContainerFactory : ExtendedPersistentDataContainerFa override fun set(key: String, dataType: PersistentDataType, value: Z) { customDataTags[key] = - registry.wrap(dataType.primitiveType, dataType.toPrimitive(value, handle.adapterContext)) + registry.wrap(dataType, dataType.toPrimitive(value, handle.adapterContext)) } override fun has(key: String, dataType: PersistentDataType): Boolean { val value = customDataTags[key] ?: return false - return registry.isInstanceOf(dataType.primitiveType, value) + return registry.isInstanceOf(dataType, value) } override fun get(key: String, dataType: PersistentDataType): Z? { val value = customDataTags[key] ?: return null - return dataType.fromPrimitive(registry.extract(dataType.primitiveType, value), handle.adapterContext) + return dataType.fromPrimitive(registry.extract(dataType, value), handle.adapterContext) } override fun getOrDefault(