Skip to content

Commit

Permalink
Merge pull request #11 from q210520993/main
Browse files Browse the repository at this point in the history
修复了卡线程
  • Loading branch information
Glomzzz authored Jul 1, 2024
2 parents 10254ab + 2a28584 commit 5d09e4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ taboolib {
isSkipKotlinRelocate =true
isSkipKotlin = true
}
taboolib = "6.1.1-beta17"
taboolib = "6.1.1"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ internal open class VanillaAttTaskBuilder(key: String, val attribute: BukkitAttr
private val valuesCache = WeakHashMap<UUID, Double>()

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
}
}


Expand Down

0 comments on commit 5d09e4e

Please sign in to comment.