diff --git a/build.gradle.kts b/build.gradle.kts index 35a0b1a..e3be762 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,7 @@ taboolib { isSkipKotlinRelocate =true isSkipKotlin = true } - taboolib = "6.1.1-beta17" + taboolib = "6.1.1" } } diff --git a/src/main/kotlin/com/skillw/attsystem/internal/feature/realizer/vanilla/VanillaAttTaskBuilder.kt b/src/main/kotlin/com/skillw/attsystem/internal/feature/realizer/vanilla/VanillaAttTaskBuilder.kt index ba070c5..c2fa6e3 100644 --- a/src/main/kotlin/com/skillw/attsystem/internal/feature/realizer/vanilla/VanillaAttTaskBuilder.kt +++ b/src/main/kotlin/com/skillw/attsystem/internal/feature/realizer/vanilla/VanillaAttTaskBuilder.kt @@ -38,11 +38,14 @@ internal open class VanillaAttTaskBuilder(key: String, val attribute: BukkitAttr private val valuesCache = WeakHashMap() protected fun changed(uuid: UUID, value: Double): Boolean = - valuesCache.run { - return if (get(uuid) != value) { - put(uuid, value) + synchronized(valuesCache) { + val current = valuesCache[uuid] + return if (current != value) { + valuesCache[uuid] = value true - } else false + } else { + false + } }