diff options
Diffstat (limited to 'src')
-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) { |