diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-11 23:02:45 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-11 23:02:45 +0200 |
commit | 6fdb072c9bc6772de93eb01ffe4fd8fee85f5189 (patch) | |
tree | fbfd0019e856f802bfd294788200bc366b6322a8 /src/main/java | |
parent | 7693ee41d191cec6584c9d5761e644fe4f738ea9 (diff) | |
download | skyhanni-6fdb072c9bc6772de93eb01ffe4fd8fee85f5189.tar.gz skyhanni-6fdb072c9bc6772de93eb01ffe4fd8fee85f5189.tar.bz2 skyhanni-6fdb072c9bc6772de93eb01ffe4fd8fee85f5189.zip |
code cleanup
Diffstat (limited to 'src/main/java')
3 files changed, 13 insertions, 38 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt index e359c619e..6ce9be7c6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemClickData.kt @@ -13,17 +13,9 @@ class ItemClickData { if (!Mouse.getEventButtonState()) return val clickType = when (Mouse.getEventButton()) { - 0 -> { - ItemClickInHandEvent.ClickType.LEFT_CLICK - } - - 1 -> { - ItemClickInHandEvent.ClickType.RIGHT_CLICK - } - - else -> { - return - } + 0 -> ItemClickInHandEvent.ClickType.LEFT_CLICK + 1 -> ItemClickInHandEvent.ClickType.RIGHT_CLICK + else -> return } val itemStack = Minecraft.getMinecraft().thePlayer.heldItem diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt index 7133a2e9b..cbeaa9c45 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyBlockLevelChatMessage.kt @@ -29,21 +29,10 @@ class SkyBlockLevelChatMessage { val colon = if (SkyHanniMod.feature.chat.playerColonHider) "" else ":" when (SkyHanniMod.feature.chat.skyblockLevelDesign) { - 0 -> { - LorenzUtils.chat("$prefix §8[§$levelColor$level§8] $name§f$colon $message") - } - - 1 -> { - LorenzUtils.chat("$prefix §$levelColor§l$level $name§f$colon $message") - } - - 2 -> { - LorenzUtils.chat("$prefix $name §8[§$levelColor$level§8]§f$colon $message") - } - - 3 -> { - LorenzUtils.chat("$prefix $name§f$colon $message") - } + 0 -> LorenzUtils.chat("$prefix §8[§$levelColor$level§8] $name§f$colon $message") + 1 -> LorenzUtils.chat("$prefix §$levelColor§l$level $name§f$colon $message") + 2 -> LorenzUtils.chat("$prefix $name §8[§$levelColor$level§8]§f$colon $message") + 3 -> LorenzUtils.chat("$prefix $name§f$colon $message") } level = -1 } 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 e9ccc363b..1d8c0771c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt @@ -190,8 +190,7 @@ class DamageIndicatorManager { if (now > damageCounter.firstTick + 1_000) { damageCounter.oldDamages.add( - 0, - OldDamage(now, damageCounter.currentDamage, damageCounter.currentHealing) + 0, OldDamage(now, damageCounter.currentDamage, damageCounter.currentHealing) ) damageCounter.firstTick = 0L damageCounter.currentDamage = 0 @@ -281,11 +280,7 @@ class DamageIndicatorManager { return checkThorn(health) } - if (entityData.bossType == BossType.SLAYER_ENDERMAN_1 || - entityData.bossType == BossType.SLAYER_ENDERMAN_2 || - entityData.bossType == BossType.SLAYER_ENDERMAN_3 || - entityData.bossType == BossType.SLAYER_ENDERMAN_4 - ) { + if (entityData.bossType == BossType.SLAYER_ENDERMAN_1 || entityData.bossType == BossType.SLAYER_ENDERMAN_2 || entityData.bossType == BossType.SLAYER_ENDERMAN_3 || entityData.bossType == BossType.SLAYER_ENDERMAN_4) { if (entity is EntityEnderman) { return checkEnderSlayer(entity, entityData, health.toInt(), maxHealth.toInt()) } @@ -310,9 +305,7 @@ class DamageIndicatorManager { } } - if (entityData.bossType == BossType.SLAYER_WOLF_3 || - entityData.bossType == BossType.SLAYER_WOLF_4 - ) { + if (entityData.bossType == BossType.SLAYER_WOLF_3 || entityData.bossType == BossType.SLAYER_WOLF_4) { if (entity is EntityWolf) { if (entity.hasNameTagWith(2, "§bCalling the pups!")) { return "Pups!" @@ -431,8 +424,9 @@ class DamageIndicatorManager { else -> return null } - val result = - NumberUtil.percentageColor(calcHealth.toLong(), calcMaxHealth.toLong()).getChatColor() + NumberUtil.format(calcHealth) + val result = NumberUtil.percentageColor( + calcHealth.toLong(), calcMaxHealth.toLong() + ).getChatColor() + NumberUtil.format(calcHealth) //Hit phase |