diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-31 18:39:39 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-31 18:39:39 +0200 |
commit | 970687f94eb69fc04e8e03f06c90ddc5d6c179b2 (patch) | |
tree | 1feb223abe051c789d0ba9aad09df8a8b5bafc72 /src/main | |
parent | 0a56f35380c8aca679f53686382787fe27fa8a76 (diff) | |
download | skyhanni-970687f94eb69fc04e8e03f06c90ddc5d6c179b2.tar.gz skyhanni-970687f94eb69fc04e8e03f06c90ddc5d6c179b2.tar.bz2 skyhanni-970687f94eb69fc04e8e03f06c90ddc5d6c179b2.zip |
Fixed damage indicator not working anymore
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt index e7be3e90f..d46bae435 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -97,11 +97,16 @@ class DamageIndicatorManager { val player = Minecraft.getMinecraft().thePlayer //TODO config to define between 100ms and 5 sec - for (uuid in data.filter { + val filter = data.filter { val waitForRemoval = if (it.value.dead && !noDeathDisplay(it.value.bossType)) 4_000 else 100 (System.currentTimeMillis() > it.value.timeLastTick + waitForRemoval) || (it.value.dead && noDeathDisplay(it.value.bossType)) - }.map { it.key }) { - data.editCopy { remove(uuid) } + } + if (filter.isNotEmpty()) { + data = data.editCopy { + for (entry in filter) { + remove(entry.key) + } + } } val sizeHealth: Double @@ -345,7 +350,7 @@ class DamageIndicatorManager { entityData.healthText = color.getChatColor() + NumberUtil.format(health) } entityData.timeLastTick = System.currentTimeMillis() - data.editCopy { this[entity.uniqueID] = entityData } + data = data.editCopy { this[entity.uniqueID] = entityData } } catch (e: Throwable) { |