diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-23 17:35:27 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-23 17:35:27 +0200 |
commit | 7c24dc583765121d9ce1fa7f933170607044ef7e (patch) | |
tree | 3b98c469a4c4639e1c651ff67b77cde3ff14f3c9 /src | |
parent | ed9021fa8c242063c55cb25bcfe4ecc77913763c (diff) | |
download | skyhanni-7c24dc583765121d9ce1fa7f933170607044ef7e.tar.gz skyhanni-7c24dc583765121d9ce1fa7f933170607044ef7e.tar.bz2 skyhanni-7c24dc583765121d9ce1fa7f933170607044ef7e.zip |
code cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFormatter.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFormatter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFormatter.kt index 16b4698cb..ea06519d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFormatter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFormatter.kt @@ -42,7 +42,7 @@ class PlayerChatFormatter { // SBA is adding another §d in front of the message //§dTo §r§b[MVP§r§3+§r§b] Skyfall55§r§7: §r§7hello :) - private var patternPrivateMessage: Pattern = Pattern.compile("(§d)+(To|From) §r(.+)§r§7: §r§7(.+)") + private var patternPrivateMessage = Pattern.compile("(§d)+(To|From) §r(.+)§r§7: §r§7(.+)") @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { 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 4a93f2647..0ab45e022 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -43,7 +43,7 @@ class DamageIndicatorManager { companion object { private var data = mutableMapOf<UUID, EntityData>() - private val damagePattern: Pattern = Pattern.compile("[✧✯]?(\\d+[⚔+✧❤♞☄✷ﬗ✯]*)") + private val damagePattern = Pattern.compile("[✧✯]?(\\d+[⚔+✧❤♞☄✷ﬗ✯]*)") fun isBoss(entity: EntityLivingBase): Boolean { return data.values.any { it.entity == entity } @@ -257,8 +257,7 @@ class DamageIndicatorManager { if (data.containsKey(entity.uniqueID)) { val lastHealth = data[entity.uniqueID]!!.lastHealth - val bossType = entityData.bossType - checkDamage(entityData, health, lastHealth, bossType) + checkDamage(entityData, health, lastHealth) tickDamage(entityData.damageCounter) BossHealthChangeEvent(entityData, lastHealth, health, maxHealth).postAndCatch() } @@ -287,6 +286,7 @@ class DamageIndicatorManager { when (entityData.bossType) { BossType.DUNGEON_F4_THORN -> return checkThorn(health) + BossType.SLAYER_ENDERMAN_1, BossType.SLAYER_ENDERMAN_2, BossType.SLAYER_ENDERMAN_3, @@ -550,7 +550,7 @@ class DamageIndicatorManager { return color.getChatColor() + health + "/" + maxHealth } - private fun checkDamage(entityData: EntityData, health: Long, lastHealth: Long, bossType: BossType) { + private fun checkDamage(entityData: EntityData, health: Long, lastHealth: Long) { val damage = lastHealth - health val healing = health - lastHealth if (damage > 0) { @@ -561,7 +561,7 @@ class DamageIndicatorManager { } if (healing > 0) { //Hide auto heal every 10 ticks (with rounding errors) - if ((healing == 15_000L || healing == 15_001L) && bossType == BossType.SLAYER_ZOMBIE_5) return + if ((healing == 15_000L || healing == 15_001L) && entityData.bossType == BossType.SLAYER_ZOMBIE_5) return val damageCounter = entityData.damageCounter damageCounter.currentHealing += healing |