aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-10-11 12:42:33 -0400
committerGitHub <noreply@github.com>2024-10-11 18:42:33 +0200
commit7c2d4ed566246513bc438272e436627412147d62 (patch)
treeedf8d3d01a49bd7c4f5993bae6367613c32fcaac /src/main/java/at/hannibal2/skyhanni/features
parent0671e35163d55ab0f940aa6806a0d7bfb2876429 (diff)
downloadskyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.gz
skyhanni-7c2d4ed566246513bc438272e436627412147d62.tar.bz2
skyhanni-7c2d4ed566246513bc438272e436627412147d62.zip
Backend: Detekt Fixes Part 6 (#2657)
Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardTips.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/BingoNextStepHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/steps/CollectionStep.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt41
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt2
-rwxr-xr-xsrc/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt23
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotMenuHighlighting.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt41
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ReforgeHelper.kt22
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt194
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt17
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTooltip.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/craft/CraftableItemList.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentationTableAPI.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairDataDisplay.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt25
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordLocationKey.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantsJson.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt29
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt46
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt104
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt4
82 files changed, 610 insertions, 435 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt
index 94bd4f6dd..b0f883ac2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt
@@ -85,12 +85,15 @@ object BingoCardDisplay {
if (BingoAPI.bingoGoals.isEmpty()) {
newList.add(Renderable.string("§6Bingo Goals:"))
- newList.add(Renderable.clickAndHover("§cOpen the §e/bingo §ccard.",
- listOf("Click to run §e/bingo"),
- onClick = {
- HypixelCommands.bingo()
- }
- ))
+ newList.add(
+ Renderable.clickAndHover(
+ "§cOpen the §e/bingo §ccard.",
+ listOf("Click to run §e/bingo"),
+ onClick = {
+ HypixelCommands.bingo()
+ }
+ )
+ )
} else {
if (!config.hideCommunityGoals.get()) {
newList.addCommunityGoals()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardTips.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardTips.kt
index abf8bbedc..83b41d3fd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardTips.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardTips.kt
@@ -81,9 +81,7 @@ object BingoCardTips {
for (line in bingoTip.guide) {
toolTip.add(index++, " $line")
}
- bingoTip.found?.let {
- toolTip.add(index++, "§7Found by: §e$it")
- }
+ toolTip.add(index++, "§7Found by: §e${bingoTip.found}")
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/BingoNextStepHelper.kt
index 2e56a536b..69602ec70 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/BingoNextStepHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/BingoNextStepHelper.kt
@@ -275,7 +275,8 @@ object BingoNextStepHelper {
"Emerald",
160 * 32,
mapOf("Emerald" to 1, "Enchanted Emerald" to 160)
- ) requires IslandType.DWARVEN_MINES.getStep())
+ ) requires IslandType.DWARVEN_MINES.getStep()
+ )
}
if (description == "Obtain a Mathematical Hoe Blueprint.") {
@@ -285,7 +286,8 @@ object BingoNextStepHelper {
"Jacob's Ticket",
32,
mapOf("Jacob's Ticket" to 1)
- ).addItemRequirements() requires IslandType.GARDEN.getStep())
+ ).addItemRequirements() requires IslandType.GARDEN.getStep()
+ )
}
crystalPattern.matchMatcher(description) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/steps/CollectionStep.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/steps/CollectionStep.kt
index 7871ae28d..10c968d84 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/steps/CollectionStep.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/nextstephelper/steps/CollectionStep.kt
@@ -6,5 +6,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat
class CollectionStep(collectionName: String, amountNeeded: Int) :
ProgressionStep(amountNeeded.shortFormat() + " $collectionName Collection", amountNeeded.toLong()) {
- val internalName by lazy { NEUInternalName.fromItemName(if (collectionName == "Mushroom") "Red Mushroom" else collectionName) }
+ val internalName by lazy {
+ NEUInternalName.fromItemName(if (collectionName == "Mushroom") "Red Mushroom" else collectionName)
+ }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
index d256bfe63..2afc9276b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
@@ -35,7 +35,8 @@ object PlayerDeathMessages {
if (MarkedPlayerManager.config.highlightInChat &&
!DungeonAPI.inDungeon() &&
!LorenzUtils.inKuudraFight &&
- MarkedPlayerManager.isMarkedPlayer(name)) {
+ MarkedPlayerManager.isMarkedPlayer(name)
+ ) {
val reason = event.reason
val color = MarkedPlayerManager.config.chatColor.getChatColor()
ChatUtils.chat(" §c☠ $color$name §7$reason", false)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt
index 3b2b93680..f40e437e5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt
@@ -279,10 +279,12 @@ object BestiaryData {
val isUnlocked = mob.actualRealTotalKill != 0.toLong()
val isMaxed = mob.percentToMax() >= 1
if (!isUnlocked) {
- newDisplay.add(buildList {
- add(" §7- ")
- add("${mob.name}: §cNot unlocked!")
- })
+ newDisplay.add(
+ buildList {
+ add(" §7- ")
+ add("${mob.name}: §cNot unlocked!")
+ }
+ )
continue
}
if (isMaxed && config.hideMaxed) continue
@@ -358,7 +360,8 @@ object BestiaryData {
// todo: avoid ordinal
config.numberFormat = BestiaryConfig.NumberFormatEntry.entries[(config.numberFormat.ordinal + 1) % 2]
update()
- })
+ }
+ )
newDisplay.addButton(
prefix = "§7Display Type: ",
@@ -367,7 +370,8 @@ object BestiaryData {
// todo: avoid ordinal
config.displayType = DisplayTypeEntry.entries[(config.displayType.ordinal + 1) % 8]
update()
- })
+ }
+ )
newDisplay.addButton(
prefix = "§7Number Type: ",
@@ -377,6 +381,7 @@ object BestiaryData {
update()
}
)
+
newDisplay.addButton(
prefix = "§7Hide Maxed: ",
getName = HideMaxed.entries[if (config.hideMaxed) 1 else 0].type,
@@ -391,18 +396,20 @@ object BestiaryData {
if (catList.isNotEmpty()) {
newDisplay.addAsSingletonList("§7Category")
for (cat in catList) {
- newDisplay.add(buildList {
- add(" §7- ${cat.name}§7: ")
- val element = when {
- cat.familiesCompleted == cat.totalFamilies -> "§c§lCompleted!"
- cat.familiesFound == cat.totalFamilies -> "§b${cat.familiesCompleted}§7/§b${cat.totalFamilies} §7completed"
- cat.familiesFound < cat.totalFamilies ->
- "§b${cat.familiesFound}§7/§b${cat.totalFamilies} §7found, §b${cat.familiesCompleted}§7/§b${cat.totalFamilies} §7completed"
-
- else -> continue
+ newDisplay.add(
+ buildList {
+ add(" §7- ${cat.name}§7: ")
+ val element = when {
+ cat.familiesCompleted == cat.totalFamilies -> "§c§lCompleted!"
+ cat.familiesFound == cat.totalFamilies -> "§b${cat.familiesCompleted}§7/§b${cat.totalFamilies} §7completed"
+ cat.familiesFound < cat.totalFamilies ->
+ "§b${cat.familiesFound}§7/§b${cat.totalFamilies} §7found, §b${cat.familiesCompleted}§7/§b${cat.totalFamilies} §7completed"
+
+ else -> continue
+ }
+ add(element)
}
- add(element)
- })
+ )
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
index 4f0dad4b8..7f5b42e3c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt
@@ -367,8 +367,8 @@ object DamageIndicatorManager {
getCustomHealth(entityData, health, entity, maxHealth) ?: return null
}
- if (data.containsKey(entity.uniqueID)) {
- val lastHealth = data[entity.uniqueID]!!.lastHealth
+ data[entity.uniqueID]?.let {
+ val lastHealth = it.lastHealth
checkDamage(entityData, health, lastHealth)
tickDamage(entityData.damageCounter)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt
index 0363543bf..4a0bed69c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt
@@ -148,7 +148,9 @@ object EnderNodeTracker {
if (!isEnabled()) return
if (!ProfileStorageData.loaded) return
- val change = event.sackChanges.firstOrNull { it.internalName == EnderNode.MITE_GEL.internalName && it.delta > 0 } ?: return
+ val change = event.sackChanges.firstOrNull {
+ it.internalName == EnderNode.MITE_GEL.internalName && it.delta > 0
+ } ?: return
tracker.modify { storage ->
storage.lootCount.addOrPut(EnderNode.MITE_GEL, change.delta)
@@ -268,7 +270,11 @@ object EnderNodeTracker {
addSearchString("§f$c§7-§a$u§7-§9$r§7-§5$e§7-§6$l §fEnderman Pet §7(§6$profit§7)")
}
- private fun calculateEnderArmor(storage: Data) = storage.lootCount.filter { isEnderArmor(it.key) }.map { it.value }.sum()
+ private fun calculateEnderArmor(storage: Data) = storage.lootCount.filter {
+ isEnderArmor(it.key)
+ }.map {
+ it.value
+ }.sum()
private fun formatDisplay(map: List<Searchable>): List<Searchable> {
if (!ProfileStorageData.loaded) return emptyList()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
index 14abcfad6..2ef652e4a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostCounter.kt
@@ -385,7 +385,7 @@ object GhostCounter {
}
percent = 100f.coerceAtMost(percent)
if (!parse) {
- sb.append(" (").append(String.format("%.2f", percent)).append("%)")
+ sb.append(" (").append(String.format(Locale.US, "%.2f", percent)).append("%)")
} else {
sb.append(" (").append(nf.format(currentSkillXp))
if (totalSkillXp != 0) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt
index b6bcff3bd..4651570e4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt
@@ -200,8 +200,8 @@ object PartyChatCommands {
var message = "Ignored player list:"
if (blacklist.size > 15) {
message += "\n§e"
- blacklist.forEachIndexed { i, it ->
- message += it
+ blacklist.forEachIndexed { i, blacklistedMessage ->
+ message += blacklistedMessage
if (i < blacklist.size - 1) {
message += ", "
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
index 8b2d60069..377d7bfd4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
@@ -138,9 +138,11 @@ object CroesusChestTracker {
val lore = item.getLore()
if (run.floor == null) run.floor =
- (if (masterPattern.matches(item.name)) "M" else "F") + (lore.firstNotNullOfOrNull {
- floorPattern.matchMatcher(it) { group("floor").romanToDecimal() }
- } ?: "0")
+ (if (masterPattern.matches(item.name)) "M" else "F") + (
+ lore.firstNotNullOfOrNull {
+ floorPattern.matchMatcher(it) { group("floor").romanToDecimal() }
+ } ?: "0"
+ )
run.openState = when {
keyUsedPattern.anyMatches(lore) -> OpenedState.KEY_USED
openedPattern.anyMatches(lore) -> OpenedState.OPENED
@@ -274,11 +276,12 @@ object CroesusChestTracker {
fun generateMaxChestAsList(): List<DungeonRunInfo> = generateMaxChest().toList()
private fun generateMaxChest(): Sequence<DungeonRunInfo> = generateSequence { DungeonRunInfo() }.take(MAX_CHESTS)
- fun getLastActiveChest(includeDungeonKey: Boolean = false): Int =
- (croesusChests?.indexOfLast {
+ private fun getLastActiveChest(includeDungeonKey: Boolean = false): Int = (
+ croesusChests?.indexOfLast {
it.floor != null &&
(it.openState == OpenedState.UNOPENED || (includeDungeonKey && it.openState == OpenedState.OPENED))
- } ?: -1) + 1
+ } ?: -1
+ ) + 1
enum class OpenedState {
UNOPENED,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt
index 662c36604..284f8424f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt
@@ -49,7 +49,8 @@ object DungeonArchitectFeatures {
if (architectItemAmount <= 0) return
GetFromSackAPI.getFromChatMessageSackItems(
- architectsFirstDraft, "§c§lPUZZLE FAILED! §r§b$name §r§efailed a puzzle. \n" +
+ architectsFirstDraft,
+ "§c§lPUZZLE FAILED! §r§b$name §r§efailed a puzzle. \n" +
"§eClick here to get §5Architect's First Draft §7(§e${architectItemAmount}x left§7)"
)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt
index a5237aeb6..4f29aca52 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt
@@ -202,7 +202,9 @@ object DungeonHideItems {
}
private fun shouldColorMovingSkull(entity: Entity) =
- SkyHanniMod.feature.dungeon.highlightSkeletonSkull && movingSkeletonSkulls[entity]?.let { it + 200 > System.currentTimeMillis() } ?: false
+ SkyHanniMod.feature.dungeon.highlightSkeletonSkull && movingSkeletonSkulls[entity]?.let {
+ it + 200 > System.currentTimeMillis()
+ } ?: false
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt
index 474e8367f..9cc4b8a10 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonLividFinder.kt
@@ -63,7 +63,7 @@ object DungeonLividFinder {
if (event.isMod(20)) {
if (lividArmorStand == null) {
- val amountArmorStands = EntityUtils.getEntities<EntityArmorStand>().filter { it.name.contains("Livid") }.count()
+ val amountArmorStands = EntityUtils.getEntities<EntityArmorStand>().count { it.name.contains("Livid") }
if (amountArmorStands >= 8) {
ErrorManager.logErrorStateWithData(
"Could not find livid",
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
index 9edf05b7b..8a0d4296f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt
@@ -86,9 +86,13 @@ object CarnivalZombieShootout {
zombie to type
}.toMap()
- drawZombies =
- if (config.highestOnly) nearbyZombies.filterValues { zombieType -> zombieType == nearbyZombies.values.maxByOrNull { it.points } }
- else nearbyZombies
+ drawZombies = if (config.highestOnly)
+ nearbyZombies.filterValues { zombieType ->
+ zombieType == nearbyZombies.values.maxByOrNull {
+ it.points
+ }
+ }
+ else nearbyZombies
lastUpdate.zombie = SimpleTimeMark.now()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt
index 20cf553b8..2f3d19c24 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt
@@ -73,7 +73,8 @@ object DianaFixChat {
HypixelCommands.particleQuality("high")
errorCounter = 0
ChatUtils.chat("Now try again!")
- })
+ }
+ )
}
} else {
if (!hasSetToggleMusic) {
@@ -87,7 +88,8 @@ object DianaFixChat {
HypixelCommands.toggleMusic()
errorCounter = 0
ChatUtils.chat("Now try again, please!")
- })
+ }
+ )
}
} else {
ErrorManager.logErrorStateWithData(
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt
index 0bb5e3dc1..35016eda3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt
@@ -175,7 +175,8 @@ object SoopyGuessBurrow {
}
val (a, b, c) = solveEquationThing(
- LorenzVec(slopeThing.size - 5, slopeThing.size - 3, slopeThing.size - 1), LorenzVec(
+ LorenzVec(slopeThing.size - 5, slopeThing.size - 3, slopeThing.size - 1),
+ LorenzVec(
slopeThing[slopeThing.size - 5],
slopeThing[slopeThing.size - 3],
slopeThing[slopeThing.size - 1]
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
index 0a144aa2f..593326c67 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
@@ -58,7 +58,9 @@ object HoppityAPI {
fun getLastRabbit(): String = this.lastNameCache
fun isHoppityEvent() = (SkyblockSeason.currentSeason == SkyblockSeason.SPRING || SkyHanniMod.feature.dev.debug.alwaysHoppitys)
- fun rarityByRabbit(rabbit: String): LorenzRarity? = hoppityRarities.firstOrNull { it.chatColorCode == rabbit.substring(0, 2) }
+ fun rarityByRabbit(rabbit: String): LorenzRarity? = hoppityRarities.firstOrNull {
+ it.chatColorCode == rabbit.substring(0, 2)
+ }
/**
* REGEX-TEST: §f1st Chocolate Milestone
@@ -111,14 +113,14 @@ object HoppityAPI {
EggFoundEvent(STRAY, it.slotNumber).post()
lastName = "§9Fish the Rabbit"
lastMeal = STRAY
- duplicate = it.stack.getLore().any { line -> duplicatePseudoStrayPattern.matches(line)}
+ duplicate = it.stack.getLore().any { line -> duplicatePseudoStrayPattern.matches(line) }
attemptFireRabbitFound()
}
"El Dorado" -> {
EggFoundEvent(STRAY, it.slotNumber).post()
lastName = "§6El Dorado"
lastMeal = STRAY
- duplicate = it.stack.getLore().any { line -> duplicateDoradoStrayPattern.matches(line)}
+ duplicate = it.stack.getLore().any { line -> duplicateDoradoStrayPattern.matches(line) }
attemptFireRabbitFound()
}
else -> return@matchMatcher
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
index 7a5e726d2..e5425af34 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt
@@ -283,7 +283,9 @@ object HoppityEggLocator {
IslandGraphs.pathFind(location, "Hoppity Egg", color, condition = { config.showPathFinder })
}
- fun isValidEggLocation(location: LorenzVec): Boolean = HoppityEggLocations.islandLocations.any { it.distance(location) < 5.0 }
+ fun isValidEggLocation(location: LorenzVec): Boolean = HoppityEggLocations.islandLocations.any {
+ it.distance(location) < 5.0
+ }
private fun ReceiveParticleEvent.isVillagerParticle() = type == EnumParticleTypes.VILLAGER_HAPPY && speed == 0.0f && count == 1
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt
index b2f806c80..4a536465c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt
@@ -98,8 +98,8 @@ object HoppityEventSummary {
if (year < currentYear || (year == currentYear && !isSpring) && config.eventSummary.enabled) {
sendStatsMessage(stats, year)
- (ProfileStorageData.profileSpecific?.hoppityEventStats?.get(year)?.also { it.summarized = true }
- ?: ErrorManager.skyHanniError("Could not save summarization state in Hoppity Event Summarization."))
+ ProfileStorageData.profileSpecific?.hoppityEventStats?.get(year)?.also { it.summarized = true }
+ ?: ErrorManager.skyHanniError("Could not save summarization state in Hoppity Event Summarization.")
}
}
@@ -131,6 +131,10 @@ object HoppityEventSummary {
)
}
+ private fun HoppityEventStats.getMilestoneCount(): Int =
+ (mealsFound[HoppityEggType.CHOCOLATE_FACTORY_MILESTONE] ?: 0) +
+ (mealsFound[HoppityEggType.CHOCOLATE_SHOP_MILESTONE] ?: 0)
+
private val summaryOperationList by lazy {
buildMap<HoppityStat, (sb: StringBuilder, stats: HoppityEventStats, year: Int) -> Unit> {
put(HoppityStat.MEAL_EGGS_FOUND) { sb, stats, year ->
@@ -155,8 +159,7 @@ object HoppityEventSummary {
}
put(HoppityStat.MILESTONE_RABBITS) { sb, stats, _ ->
- ((stats.mealsFound[HoppityEggType.CHOCOLATE_FACTORY_MILESTONE] ?: 0) +
- (stats.mealsFound[HoppityEggType.CHOCOLATE_SHOP_MILESTONE] ?: 0)).takeIf { it > 0 }?.let {
+ stats.getMilestoneCount().takeIf { it > 0 }?.let {
sb.appendHeadedLine("§7You claimed §b$it §6§lMilestone §r§6${StringUtils.pluralize(it, "Rabbit")}§7.")
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt
index 0546e5ff9..bf324a8f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt
@@ -68,7 +68,8 @@ object HoppityNpc {
IslandGraphs.pathFind(
LorenzVec(6.4, 70.0, 7.4),
"§aHoppity's Shop",
- condition = { config.hoppityShopReminder })
+ condition = { config.hoppityShopReminder }
+ )
}
},
)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt
index 5f64aba8c..3eac15fc6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt
@@ -64,7 +64,11 @@ object ChumBucketHider {
}
// Chum Bucket
- if (config.hideBucket.get() && entity.inventory.any { it != null && (it.name == "§fEmpty Chum Bucket" || it.name == "§aEmpty Chumcap Bucket") }) {
+ if (config.hideBucket.get() &&
+ entity.inventory.any {
+ it != null && (it.name == "§fEmpty Chum Bucket" || it.name == "§aEmpty Chumcap Bucket")
+ }
+ ) {
val entityLocation = entity.getLorenzVec()
for (title in titleEntity.toSet()) {
if (entityLocation.equalsIgnoreY(title.getLorenzVec())) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishAPI.kt
index fec662f39..3a6333a9c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishAPI.kt
@@ -21,7 +21,7 @@ object TrophyFishAPI {
|${TrophyRarity.BRONZE.formattedString}: ${formatCount(counts, TrophyRarity.BRONZE)}
|
|§7Total: ${bestFishObtained.formatCode}${counts.values.sum().addSeparators()}
- """.trimMargin()
+ """.trimMargin()
}
private fun formatCount(counts: Map<TrophyRarity, Int>, rarity: TrophyRarity): String {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
index 6cbda5b04..760df6432 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt
@@ -76,7 +76,7 @@ object AnitaMedalProfit {
}
private fun readItem(slot: Int, item: ItemStack, table: MutableList<DisplayTableEntry>) {
- val itemName = getItemName(item) ?: return
+ val itemName = getItemName(item)
if (itemName == " ") return
if (itemName == "§cClose") return
if (itemName == "§eUnique Gold Medals") return
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
index 3a661161e..290c5427b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
@@ -74,7 +74,9 @@ enum class CropType(
fun getByNameOrNull(itemName: String): CropType? {
if (itemName == "Red Mushroom" || itemName == "Brown Mushroom") return MUSHROOM
if (itemName == "Seeds") return WHEAT
- return entries.firstOrNull { it.cropName.equals(itemName, ignoreCase = true) || it.simpleName.equals(itemName, ignoreCase = true) }
+ return entries.firstOrNull {
+ it.cropName.equals(itemName, ignoreCase = true) || it.simpleName.equals(itemName, ignoreCase = true)
+ }
}
fun getByName(name: String) = getByNameOrNull(name) ?: error("No valid crop type '$name'")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
index c79bbb461..d0a386272 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt
@@ -515,8 +515,10 @@ object GardenNextJacobContest {
}
private fun isEnabled() =
- config.display && ((LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden)) ||
- (OutsideSbFeature.NEXT_JACOB_CONTEST.isSelected() && !LorenzUtils.inSkyBlock))
+ config.display && (
+ (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden)) ||
+ (OutsideSbFeature.NEXT_JACOB_CONTEST.isSelected() && !LorenzUtils.inSkyBlock)
+ )
private fun isFetchEnabled() = isEnabled() && config.fetchAutomatically
private fun isSendEnabled() =
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
index 8ad8d21da..373eadfe9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
@@ -191,7 +191,7 @@ object GardenPlotAPI {
}
fun Plot.markExpiredSprayAsNotified() {
- getData()?.apply { sprayHasNotified = true }
+ getData()?.sprayHasNotified = true
}
private fun Plot.setSpray(spray: SprayType, duration: Duration) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt
index 171df87e7..ef1aaa1bd 100755
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt
@@ -60,8 +60,10 @@ object GardenYawAndPitch {
}
private fun isEnabled() =
- config.enabled && ((OutsideSbFeature.YAW_AND_PITCH.isSelected() && !LorenzUtils.inSkyBlock) ||
- (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden)))
+ config.enabled && (
+ (OutsideSbFeature.YAW_AND_PITCH.isSelected() && !LorenzUtils.inSkyBlock) ||
+ (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden))
+ )
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
index 058ae1590..ffc77934b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt
@@ -49,7 +49,7 @@ object ComposterDisplay {
val pattern by lazy { rawPattern.toPattern() }
fun addToList(map: Map<DataType, String>): List<Any> {
- return listOf(displayItem, map[this]!!)
+ return map[this]?.let { listOf(displayItem, it) } ?: emptyList()
}
}
@@ -72,7 +72,6 @@ object ComposterDisplay {
val newDisplay = mutableListOf<List<Any>>()
newDisplay.addAsSingletonList("§bComposter")
-
newDisplay.add(DataType.TIME_LEFT.addToList(tabListData))
val list = mutableListOf<Any>()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
index d7452725f..6059eded9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt
@@ -344,7 +344,7 @@ object ComposterOverlay {
newList.addAsSingletonList(" §7$compostPerTitle: §e${multiplier.roundTo(2)}$compostPerTitlePreview")
val organicMatterPrice = getPrice(organicMatterItem)
- val organicMatterFactor = organicMatterFactors[organicMatterItem]!!
+ val organicMatterFactor = organicMatterFactors[organicMatterItem] ?: 1.0
val organicMatterRequired = ComposterAPI.organicMatterRequiredPer(null)
val organicMatterRequiredPreview = ComposterAPI.organicMatterRequiredPer(upgrade)
@@ -353,7 +353,7 @@ object ComposterOverlay {
val organicMatterPricePerPreview = organicMatterPrice * (organicMatterRequiredPreview / organicMatterFactor)
val fuelPrice = getPrice(fuelItem)
- val fuelFactor = fuelFactors[fuelItem]!!
+ val fuelFactor = fuelFactors[fuelItem] ?: 1.0
val fuelRequired = ComposterAPI.fuelRequiredPer(null)
val fuelRequiredPreview = ComposterAPI.fuelRequiredPer(upgrade)
@@ -427,7 +427,7 @@ object ComposterOverlay {
i++
if (i < testOffset) continue
if (first == null) first = internalName
- val factor = factors[internalName]!!
+ val factor = factors[internalName] ?: 1.0
val item = internalName.getItemStack()
val price = getPrice(internalName)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt
index bb9f9ea21..399c4cfad 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestTimeNeeded.kt
@@ -168,16 +168,19 @@ object JacobContestTimeNeeded {
showLine = line
}
}
- map[crop] = Renderable.hoverTips(showLine, buildList {
- add("§7Time Needed for §9${crop.cropName} Medals§7:")
- addAll(brackets)
- add("")
- val latestFF = crop.getLatestTrueFarmingFortune() ?: 0.0
- add("§7Latest FF: §e${(latestFF).addSeparators()}")
- val bps = crop.getBps()?.roundTo(1) ?: 0
- add("§7${addBpsTitle()}§e${bps.addSeparators()}")
- addAll(lowBPSWarning)
- })
+ map[crop] = Renderable.hoverTips(
+ showLine,
+ buildList {
+ add("§7Time Needed for §9${crop.cropName} Medals§7:")
+ addAll(brackets)
+ add("")
+ val latestFF = crop.getLatestTrueFarmingFortune() ?: 0.0
+ add("§7Latest FF: §e${(latestFF).addSeparators()}")
+ val bps = crop.getBps()?.roundTo(1) ?: 0
+ add("§7${addBpsTitle()}§e${bps.addSeparators()}")
+ addAll(lowBPSWarning)
+ }
+ )
}
private fun addBpsTitle() = if (config.jacobContestCustomBps) "Custom Blocks/Second: " else "Your Blocks/Second: "
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
index 217da9735..87306744e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt
@@ -229,7 +229,7 @@ object CropMoneyDisplay {
}
val coinsColor = if (isCurrent && config.compact) "§e" else "§6"
- val moneyArray = moneyPerHourData[internalName]!!
+ val moneyArray = moneyPerHourData[internalName] ?: emptyArray()
for (price in moneyArray) {
val finalPrice = price + extraMushroomCowPerkCoins + extraDicerCoins + extraArmorCoins
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt
index 74c59674f..9a47acaa1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt
@@ -89,7 +89,7 @@ object CropSpeedMeter {
snapshot = emptyList()
} else {
currentCrop?.let {
- val crops = it.getCounter() - startCrops[it]!!
+ val crops = it.getCounter() - (startCrops[it] ?: 0L)
val blocks = currentBlocks
val cropsPerBlocks = (crops.toDouble() / blocks.toDouble()).roundTo(3)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
index 24edf8d43..3da9945b5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt
@@ -123,12 +123,6 @@ object FarmingWeightDisplay {
private var nextPlayers = mutableListOf<UpcomingLeaderboardPlayer>()
private val nextPlayer get() = nextPlayers.firstOrNull()
- private val recalculate by lazy {
- ({
- resetData()
- })
- }
-
private val eliteWeightApiGson by lazy {
BaseGsonBuilder.gson()
.registerTypeAdapter(CropType::class.java, SkyHanniTypeAdapters.CROP_TYPE.nullSafe())
@@ -141,22 +135,22 @@ object FarmingWeightDisplay {
Renderable.clickAndHover(
"§cFarming Weight error: Cannot load",
listOf("§eClick here to reload the data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
),
Renderable.clickAndHover(
"§cdata from Elite Farmers!",
listOf("§eClick here to reload the data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
),
Renderable.clickAndHover(
"§eRejoin the garden or",
listOf("§eClick here to reload the data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
),
Renderable.clickAndHover(
"§eclick here to fix it.",
listOf("§eClick here to reload the data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
),
)
}
@@ -268,7 +262,7 @@ object FarmingWeightDisplay {
val nextPlayer = nextPlayer ?: return Renderable.clickAndHover(
"§cWaiting for leaderboard update...",
listOf("§eClick here to load new data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
)
val showRankGoal = leaderboardPosition == -1 || leaderboardPosition > rankGoal
var nextName =
@@ -304,7 +298,7 @@ object FarmingWeightDisplay {
return Renderable.clickAndHover(
"§cRejoin the garden to show ETA!",
listOf("Click here to calculate the data right now!"),
- onClick = recalculate,
+ onClick = ::resetData,
)
}
@@ -366,8 +360,12 @@ object FarmingWeightDisplay {
)
}
- private fun isEnabled() = ((OutsideSbFeature.FARMING_WEIGHT.isSelected() && !LorenzUtils.inSkyBlock) ||
- (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden))) && config.display
+ private fun isEnabled() = (
+ config.display && (
+ OutsideSbFeature.FARMING_WEIGHT.isSelected() && !LorenzUtils.inSkyBlock
+ ) ||
+ (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden))
+ )
private fun isEtaEnabled() = config.overtakeETA
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
index 7189199a9..aca1751b0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt
@@ -156,14 +156,16 @@ object GardenCropMilestoneDisplay {
val useCustomGoal = customTargetLevel != 0 && customTargetLevel > currentTier
nextTier = if (useCustomGoal) customTargetLevel else nextTier
- lineMap[MilestoneTextEntry.MILESTONE_TIER] = Renderable.horizontalContainer(buildList {
- addCropIconRenderable(crop)
- if (crop.isMaxed(overflowDisplay) && !overflowDisplay) {
- addString("§7" + crop.cropName + " §eMAXED")
- } else {
- addString("§7" + crop.cropName + " §8$currentTier➜§3$nextTier")
+ lineMap[MilestoneTextEntry.MILESTONE_TIER] = Renderable.horizontalContainer(
+ buildList {
+ addCropIconRenderable(crop)
+ if (crop.isMaxed(overflowDisplay) && !overflowDisplay) {
+ addString("§7" + crop.cropName + " §eMAXED")
+ } else {
+ addString("§7" + crop.cropName + " §8$currentTier➜§3$nextTier")
+ }
}
- })
+ )
val allowOverflowOrCustom = overflowDisplay || useCustomGoal
val cropsForNextTier = GardenCropMilestones.getCropsForTier(nextTier, crop, allowOverflowOrCustom)
@@ -302,10 +304,12 @@ object GardenCropMilestoneDisplay {
val missing = need - have
lineMap[MushroomTextEntry.TITLE] = Renderable.string("§6Mooshroom Cow Perk")
- lineMap[MushroomTextEntry.MUSHROOM_TIER] = Renderable.horizontalContainer(buildList {
- addCropIconRenderable(mushroom)
- addString("§7Mushroom Milestone $nextTier")
- })
+ lineMap[MushroomTextEntry.MUSHROOM_TIER] = Renderable.horizontalContainer(
+ buildList {
+ addCropIconRenderable(mushroom)
+ addString("§7Mushroom Milestone $nextTier")
+ }
+ )
lineMap[MushroomTextEntry.NUMBER_OUT_OF_TOTAL] = Renderable.string("§e$haveFormat§8/§e$needFormat")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt
index 660c772ab..3771dd112 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt
@@ -53,9 +53,13 @@ class FFGuideGUI : GuideGUI<FFGuideGUI.FortuneGuidePage>(FortuneGuidePage.OVERVI
vTab(ItemStack(Items.gold_ingot), Renderable.string("§eBreakdown")) {
currentPage = if (currentCrop == null) FortuneGuidePage.OVERVIEW else FortuneGuidePage.CROP
},
- vTab(ItemStack(Items.map), Renderable.string("§eUpgrades")) {
+ vTab(
+ ItemStack(Items.map),
+ Renderable.string("§eUpgrades")
+ ) {
currentPage = FortuneGuidePage.UPGRADES
- })
+ }
+ )
horizontalTabs = buildList {
add(
hTab(ItemStack(Blocks.grass), Renderable.string("§eOverview")) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt
index 7b667afaf..349144299 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt
@@ -15,7 +15,8 @@ enum class FortuneStats(
),
CROP_TOTAL(
{ crop -> "§6${crop.niceName.firstLetterUppercase()} Farming Fortune" },
- { "§7§2Farming fortune for this crop" }),
+ { "§7§2Farming fortune for this crop" }
+ ),
ACCESSORY("§2Talisman Bonus", "§7§2Fortune from your talisman\n§2You get 10☘ per talisman tier"),
CROP_UPGRADE("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n§2You get 5☘ per level"),
BASE_TOOL("§2Base tool fortune", "§7§2Crop specific fortune from your tool"),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
index cd76262c0..aabee53c8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt
@@ -90,7 +90,7 @@ object FortuneUpgrades {
private fun getEquipmentUpgrades() {
val visitors = GardenAPI.storage?.uniqueVisitors?.toDouble() ?: 0.0
for (piece in FarmingItems.equip) {
- val item = piece.getItem() ?: return
+ val item = piece.getItem()
// todo tell them to buy the missing item
if (!item.getInternalName().contains("LOTUS")) return
val enchantments = item.getEnchantments() ?: emptyMap()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotMenuHighlighting.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotMenuHighlighting.kt
index af84bd771..3ca75b179 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotMenuHighlighting.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotMenuHighlighting.kt
@@ -29,7 +29,9 @@ object GardenPlotMenuHighlighting {
val list = mutableListOf<PlotStatusType>()
val plot = GardenPlotAPI.plots.find { it.inventorySlot == slot.slotIndex } ?: continue
- val (pestsEnabled, spraysEnabled, locksEnabled, currentEnabled, pastesEnabled) = PlotStatusType.entries.map { it in config.deskPlotStatusTypes }
+ val (pestsEnabled, spraysEnabled, locksEnabled, currentEnabled, pastesEnabled) = PlotStatusType.entries.map {
+ it in config.deskPlotStatusTypes
+ }
if (plot.pests >= 1 && pestsEnabled) list.add(PlotStatusType.PESTS)
if (plot.currentSpray != null && spraysEnabled) list.add(PlotStatusType.SPRAYS)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
index d8754fd81..690592d52 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt
@@ -157,8 +157,8 @@ object PestFinder {
val isInaccurate = plot.isPestCountInaccurate
val location = playerLocation.copy(x = middle.x, z = middle.z)
event.drawWaypointFilled(location, LorenzColor.RED.toColor())
- val text = "§e" + (if (isInaccurate) "?" else
- pests
+ val text = "§e" + (
+ if (isInaccurate) "?" else pests
) + " §c$pestsName §7in §b$plotName"
event.drawDynamicText(
location, text, 1.5,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt
index a413f295a..a3536c196 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt
@@ -100,7 +100,8 @@ object HighlightVisitorsOutsideOfGarden {
if (isVisitor(entity) || (entity is EntityArmorStand && isVisitorNearby(entity.getLorenzVec()))) {
event.cancel()
if (packet.action == C02PacketUseEntity.Action.INTERACT) {
- ChatUtils.chatAndOpenConfig("Blocked you from interacting with a visitor. Sneak to bypass or click here to change settings.",
+ ChatUtils.chatAndOpenConfig(
+ "Blocked you from interacting with a visitor. Sneak to bypass or click here to change settings.",
GardenAPI.config.visitors::blockInteracting
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
index e1c5d3f84..f20479b65 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
@@ -352,10 +352,11 @@ private fun getTitleDisplayPair(): List<ScoreboardElementType> {
}
return if (displayConfig.titleAndFooter.useCustomTitle) {
- listOf(displayConfig.titleAndFooter.customTitle.get().toString()
- .replace("&", "§")
- .split("\\n")
- .map { it to alignment }
+ listOf(
+ displayConfig.titleAndFooter.customTitle.get().toString()
+ .replace("&", "§")
+ .split("\\n")
+ .map { it to alignment }
).flatten()
} else {
listOf(ScoreboardData.objectiveTitle to alignment)
@@ -585,15 +586,16 @@ private fun getLobbyDisplayPair(): List<ScoreboardElementType> {
}
private fun getPowerDisplayPair() = listOf(
- (MaxwellAPI.currentPower?.let {
- val mp = if (maxwellConfig.showMagicalPower) "§7(§6${MaxwellAPI.magicalPower?.addSeparators()}§7)" else ""
- if (displayConfig.displayNumbersFirst) {
- "§a${it.replace(" Power", "")} Power $mp"
- } else {
- "Power: §a$it $mp"
- }
- }
- ?: "§cOpen \"Your Bags\"!") to HorizontalAlignment.LEFT,
+ (
+ MaxwellAPI.currentPower?.let {
+ val mp = if (maxwellConfig.showMagicalPower) "§7(§6${MaxwellAPI.magicalPower?.addSeparators()}§7)" else ""
+ if (displayConfig.displayNumbersFirst) {
+ "§a${it.replace(" Power", "")} Power $mp"
+ } else {
+ "Power: §a$it $mp"
+ }
+ } ?: "§cOpen \"Your Bags\"!"
+ ) to HorizontalAlignment.LEFT,
)
private fun getTuningDisplayPair(): List<Pair<String, HorizontalAlignment>> {
@@ -641,10 +643,11 @@ private fun getTuningDisplayPair(): List<Pair<String, HorizontalAlignment>> {
private fun getPowerShowWhen() = !inAnyIsland(IslandType.THE_RIFT)
private fun getCookieDisplayPair() = listOf(
- "§dCookie Buff§f: " + (BitsAPI.cookieBuffTime?.let {
- if (!BitsAPI.hasCookieBuff()) "§cNot Active" else it.timeUntil().format(maxUnits = 2)
- }
- ?: "§cOpen SbMenu!") to HorizontalAlignment.LEFT,
+ "§dCookie Buff§f: " + (
+ BitsAPI.cookieBuffTime?.let {
+ if (!BitsAPI.hasCookieBuff()) "§cNot Active" else it.timeUntil().format(maxUnits = 2)
+ } ?: "§cOpen SbMenu!"
+ ) to HorizontalAlignment.LEFT,
)
private fun getCookieShowWhen(): Boolean {
@@ -852,7 +855,9 @@ private fun getExtraDisplayPair(): List<ScoreboardElementType> {
val lines = recentUnknownLines()
if (lines.isEmpty()) return listOf("<hidden>" to HorizontalAlignment.LEFT)
- return listOf("§cUndetected Lines:" to HorizontalAlignment.LEFT) + lines.map { it.line to HorizontalAlignment.LEFT }
+ return listOf("§cUndetected Lines:" to HorizontalAlignment.LEFT) + lines.map {
+ it.line to HorizontalAlignment.LEFT
+ }
}
private fun getExtraShowWhen(): Boolean = recentUnknownLines().isNotEmpty()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
index 3d8251dfb..8dd3af9f7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardEvent.kt
@@ -441,7 +441,8 @@ private fun getBroodmotherLines(): List<String> =
private fun getMiningEventsLines() = buildList {
// Wind
if (getSbLines().any { SbPattern.windCompassPattern.matches(it) } &&
- getSbLines().any { SbPattern.windCompassArrowPattern.matches(it) }) {
+ getSbLines().any { SbPattern.windCompassArrowPattern.matches(it) }
+ ) {
add(getSbLines().first { SbPattern.windCompassPattern.matches(it) })
add("| ${getSbLines().first { SbPattern.windCompassArrowPattern.matches(it) }} §f|")
}
@@ -454,14 +455,16 @@ private fun getMiningEventsLines() = buildList {
// Zone Events
if (getSbLines().any { SbPattern.miningEventPattern.matches(it) } &&
- getSbLines().any { SbPattern.miningEventZonePattern.matches(it) }) {
+ getSbLines().any { SbPattern.miningEventZonePattern.matches(it) }
+ ) {
add(getSbLines().first { SbPattern.miningEventPattern.matches(it) }.removePrefix("Event: "))
add("in ${getSbLines().first { SbPattern.miningEventZonePattern.matches(it) }.removePrefix("Zone: ")}")
}
// Zone Events but no Zone Line
if (getSbLines().any { SbPattern.miningEventPattern.matches(it) } &&
- getSbLines().none { SbPattern.miningEventZonePattern.matches(it) }) {
+ getSbLines().none { SbPattern.miningEventZonePattern.matches(it) }
+ ) {
add(
getSbLines().first { SbPattern.miningEventPattern.matches(it) }
.removePrefix("Event: "),
@@ -470,21 +473,24 @@ private fun getMiningEventsLines() = buildList {
// Mithril Gourmand
if (getSbLines().any { SbPattern.mithrilRemainingPattern.matches(it) } &&
- getSbLines().any { SbPattern.mithrilYourMithrilPattern.matches(it) }) {
+ getSbLines().any { SbPattern.mithrilYourMithrilPattern.matches(it) }
+ ) {
add(getSbLines().first { SbPattern.mithrilRemainingPattern.matches(it) })
add(getSbLines().first { SbPattern.mithrilYourMithrilPattern.matches(it) })
}
// Raffle
if (getSbLines().any { SbPattern.raffleTicketsPattern.matches(it) } &&
- getSbLines().any { SbPattern.rafflePoolPattern.matches(it) }) {
+ getSbLines().any { SbPattern.rafflePoolPattern.matches(it) }
+ ) {
add(getSbLines().first { SbPattern.raffleTicketsPattern.matches(it) })
add(getSbLines().first { SbPattern.rafflePoolPattern.matches(it) })
}
// Raid
if (getSbLines().any { SbPattern.yourGoblinKillsPattern.matches(it) } &&
- getSbLines().any { SbPattern.remainingGoblinPattern.matches(it) }) {
+ getSbLines().any { SbPattern.remainingGoblinPattern.matches(it) }
+ ) {
add(getSbLines().first { SbPattern.yourGoblinKillsPattern.matches(it) })
add(getSbLines().first { SbPattern.remainingGoblinPattern.matches(it) })
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
index 43a598839..40eb8c4b3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -298,7 +298,11 @@ object ItemDisplayOverlayFeatures {
}
}
- if (BESTIARY_LEVEL.isSelected() && (chestName.contains("Bestiary ➜") || chestName.contains("Fishing ➜")) && lore.any { it.contains("Deaths: ") }) {
+ if (BESTIARY_LEVEL.isSelected() && (chestName.contains("Bestiary ➜") || chestName.contains("Fishing ➜")) &&
+ lore.any {
+ it.contains("Deaths: ")
+ }
+ ) {
lore.matchFirst(bestiaryStackPattern) {
val tier = (group("tier").romanToDecimalIfNecessary() - 1)
return tier.toString()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt
index 8e2a5c592..d89c2aca9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemStars.kt
@@ -32,7 +32,7 @@ object ItemStars {
@SubscribeEvent(priority = EventPriority.LOW)
fun onTooltip(event: LorenzToolTipEvent) {
if (!isEnabled()) return
- val stack = event.itemStack ?: return
+ val stack = event.itemStack
if (stack.stackSize != 1) return
val itemName = stack.name
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt
index 517cf4b59..516ee08fd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/MaxPurseItems.kt
@@ -88,7 +88,8 @@ object MaxPurseItems {
"§7Max items with purse",
"§7Buy order +0.1: §e${buyOrders.addSeparators()}x",
"§7Instant buy: §e${buyInstant.addSeparators()}x"
- ), posLabel = "Max Items With Purse"
+ ),
+ posLabel = "Max Items With Purse"
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ReforgeHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ReforgeHelper.kt
index 2854b47df..1c098000c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ReforgeHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ReforgeHelper.kt
@@ -288,7 +288,9 @@ object ReforgeHelper {
} else emptyList()
}
- val addedEffect = getReforgeEffect(reforge, itemRarity)?.let { listOf(renderableString(addEffectText)) + it } ?: emptyList()
+ val addedEffect = getReforgeEffect(reforge, itemRarity)?.let {
+ listOf(renderableString(addEffectText)) + it
+ } ?: emptyList()
return listOf(renderableString("§6Reforge Stats")) + stats + removedEffect + addedEffect + click
}
@@ -414,15 +416,17 @@ object ReforgeHelper {
private fun SkyblockStatList.print(appliedReforge: SkyblockStatList? = null): List<Renderable> {
val diff = appliedReforge?.takeIf { config.showDiff }?.let { this - it }
- val main = ((diff ?: this).mapNotNull {
- val key = it.key
- val value = this[key] ?: 0.0
- buildList<Renderable> {
- add(renderableString("§9${value.toStringWithPlus().removeSuffix(".0")}"))
- diff?.get(key)?.let { add(renderableString((if (it < 0) "§c" else "§a") + it.toStringWithPlus().removeSuffix(".0"))) }
- add(renderableString(key.iconWithName))
+ val main = (
+ (diff ?: this).mapNotNull {
+ val key = it.key
+ val value = this[key] ?: 0.0
+ buildList {
+ add(renderableString("§9${value.toStringWithPlus().removeSuffix(".0")}"))
+ diff?.get(key)?.let { add(renderableString((if (it < 0) "§c" else "§a") + it.toStringWithPlus().removeSuffix(".0"))) }
+ add(renderableString(key.iconWithName))
+ }
}
- })
+ )
val table = Renderable.table(main, 5)
return listOf(table)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
index 1489ba83f..fe1495935 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt
@@ -93,71 +93,73 @@ object SackDisplay {
totalPrice += price
if (rendered >= config.itemToShow) continue
if (stored == 0 && !config.showEmpty) continue
- table[buildList {
- addString(" §7- ")
- addItemStack(internalName)
- // TODO move replace into itemName
- val nameText = Renderable.optionalLink(
- itemName.replace("§k", ""),
- onClick = {
- if (!SackAPI.isTrophySack) {
- BazaarApi.searchForBazaarItem(itemName)
+ table[
+ buildList {
+ addString(" §7- ")
+ addItemStack(internalName)
+ // TODO move replace into itemName
+ val nameText = Renderable.optionalLink(
+ itemName.replace("§k", ""),
+ onClick = {
+ if (!SackAPI.isTrophySack) {
+ BazaarApi.searchForBazaarItem(itemName)
+ }
+ },
+ highlightsOnHoverSlots = listOf(slot)
+ ) { !NEUItems.neuHasFocus() }
+ add(nameText)
+
+
+ when (config.numberFormat) {
+ NumberFormatEntry.DEFAULT -> {
+ addAlignedNumber("$colorCode${stored.addSeparators()}")
+ addString("§7/")
+ addAlignedNumber("§b${total.shortFormat()}")
}
- },
- highlightsOnHoverSlots = listOf(slot)
- ) { !NEUItems.neuHasFocus() }
- add(nameText)
+ NumberFormatEntry.FORMATTED -> {
+ addAlignedNumber("$colorCode${stored.shortFormat()}")
+ addString("§7/")
+ addAlignedNumber("§b${total.shortFormat()}")
+ }
- when (config.numberFormat) {
- NumberFormatEntry.DEFAULT -> {
- addAlignedNumber("$colorCode${stored.addSeparators()}")
- addString("§7/")
- addAlignedNumber("§b${total.shortFormat()}")
- }
-
- NumberFormatEntry.FORMATTED -> {
- addAlignedNumber("$colorCode${stored.shortFormat()}")
- addString("§7/")
- addAlignedNumber("§b${total.shortFormat()}")
- }
-
- NumberFormatEntry.UNFORMATTED -> {
- addAlignedNumber("$colorCode${stored.addSeparators()}")
- addString("§7/")
- addAlignedNumber("§b${total.addSeparators()}")
- }
+ NumberFormatEntry.UNFORMATTED -> {
+ addAlignedNumber("$colorCode${stored.addSeparators()}")
+ addString("§7/")
+ addAlignedNumber("§b${total.addSeparators()}")
+ }
- else -> {
- addAlignedNumber("$colorCode${stored.addSeparators()}")
- addString("§7/")
- addAlignedNumber("§b${total.addSeparators()}")
+ else -> {
+ addAlignedNumber("$colorCode${stored.addSeparators()}")
+ addString("§7/")
+ addAlignedNumber("§b${total.addSeparators()}")
+ }
}
- }
- // TODO change color of amount if full
-// if (colorCode == "§a") addString("§c§l(Full!)")
-
- if (SackAPI.isTrophySack && magmaFish > 0) {
- totalMagmaFish += magmaFish
- add(
- Renderable.hoverTips(
- Renderable.string(
- "§d$magmaFish",
- horizontalAlign = config.alignment
- ),
- listOf(
- "§6Magmafish: §b${magmaFish.addSeparators()}",
- "§6Magmafish value: §b${price / magmaFish}",
- "§6Magmafish per: §b${magmaFish / stored}"
- ),
+ // TODO change color of amount if full
+ // if (colorCode == "§a") addString("§c§l(Full!)")
+
+ if (SackAPI.isTrophySack && magmaFish > 0) {
+ totalMagmaFish += magmaFish
+ add(
+ Renderable.hoverTips(
+ Renderable.string(
+ "§d$magmaFish",
+ horizontalAlign = config.alignment
+ ),
+ listOf(
+ "§6Magmafish: §b${magmaFish.addSeparators()}",
+ "§6Magmafish value: §b${price / magmaFish}",
+ "§6Magmafish per: §b${magmaFish / stored}"
+ ),
+ )
)
- )
- // TODO add cache
- addItemStack("MAGMA_FISH".asInternalName())
+ // TODO add cache
+ addItemStack("MAGMA_FISH".asInternalName())
+ }
+ if (config.showPrice && price != 0L) addAlignedNumber("§6${format(price)}")
}
- if (config.showPrice && price != 0L) addAlignedNumber("§6${format(price)}")
- }] = itemName
+ ] = itemName
rendered++
}
list.add(table.buildSearchableTable())
@@ -187,13 +189,15 @@ object SackDisplay {
val name = SortType.entries[config.sortingType.ordinal].longName // todo avoid ordinal
list.addString("§7Sorted By: §c$name")
- list.addSelector<SortType>(" ",
+ list.addSelector<SortType>(
+ " ",
getName = { type -> type.shortName },
isCurrent = { it.ordinal == config.sortingType.ordinal }, // todo avoid ordinal
onChange = {
config.sortingType = SortingTypeEntry.entries[it.ordinal] // todo avoid ordinals
update(false)
- })
+ }
+ )
list.addButton(
prefix = "§7Number format: ",
@@ -207,13 +211,15 @@ object SackDisplay {
)
if (config.showPrice) {
- list.addSelector<ItemPriceSource>(" ",
+ list.addSelector<ItemPriceSource>(
+ " ",
getName = { type -> type.sellName },
isCurrent = { it.ordinal == config.priceSource.ordinal }, // todo avoid ordinal
onChange = {
config.priceSource = ItemPriceSource.entries[it.ordinal] // todo avoid ordinal
update(false)
- })
+ }
+ )
list.addButton(
prefix = "§7Price Format: ",
getName = PriceFormat.entries[config.priceFormat.ordinal].displayName, // todo avoid ordinal
@@ -234,20 +240,22 @@ object SackDisplay {
val table = mutableMapOf<List<Renderable>, String?>()
for ((name, rune) in sort(SackAPI.runeItem.toList())) {
val (stack, lv1, lv2, lv3) = rune
- table[buildList {
- addString(" §7- ")
- stack?.let { addItemStack(it) }
- add(
- Renderable.optionalLink(
- name,
- onClick = {},
- highlightsOnHoverSlots = listOf(rune.slot)
+ table[
+ buildList {
+ addString(" §7- ")
+ stack?.let { addItemStack(it) }
+ add(
+ Renderable.optionalLink(
+ name,
+ onClick = {},
+ highlightsOnHoverSlots = listOf(rune.slot)
+ )
)
- )
- addAlignedNumber("§e$lv1")
- addAlignedNumber("§e$lv2")
- addAlignedNumber("§e$lv3")
- }] = name
+ addAlignedNumber("§e$lv1")
+ addAlignedNumber("§e$lv2")
+ addAlignedNumber("§e$lv3")
+ }
+ ] = name
}
list.add(table.buildSearchableTable())
}
@@ -259,23 +267,27 @@ object SackDisplay {
val table = mutableMapOf<List<Renderable>, String?>()
for ((name, gem) in sort(SackAPI.gemstoneItem.toList())) {
val (internalName, rough, flawed, fine, roughprice, flawedprice, fineprice) = gem
- table[buildList {
- addString(" §7- ")
- addItemStack(internalName)
- add(Renderable.optionalLink(
- name,
- onClick = {
- BazaarApi.searchForBazaarItem(name.dropLast(1))
- },
- highlightsOnHoverSlots = listOf(gem.slot)
- ) { !NEUItems.neuHasFocus() })
- addAlignedNumber(rough.addSeparators())
- addAlignedNumber("§a${flawed.addSeparators()}")
- addAlignedNumber("§9${fine.addSeparators()}")
- val price = roughprice + flawedprice + fineprice
- totalPrice += price
- if (config.showPrice && price != 0L) addAlignedNumber("§7(§6${format(price)}§7)")
- }] = name
+ table[
+ buildList {
+ addString(" §7- ")
+ addItemStack(internalName)
+ add(
+ Renderable.optionalLink(
+ name,
+ onClick = {
+ BazaarApi.searchForBazaarItem(name.dropLast(1))
+ },
+ highlightsOnHoverSlots = listOf(gem.slot)
+ ) { !NEUItems.neuHasFocus() }
+ )
+ addAlignedNumber(rough.addSeparators())
+ addAlignedNumber("§a${flawed.addSeparators()}")
+ addAlignedNumber("§9${fine.addSeparators()}")
+ val price = roughprice + flawedprice + fineprice
+ totalPrice += price
+ if (config.showPrice && price != 0L) addAlignedNumber("§7(§6${format(price)}§7)")
+ }
+ ] = name
}
list.add(table.buildSearchableTable())
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt
index e0d7e207c..c95950a85 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt
@@ -175,7 +175,9 @@ class SkyblockGuideHighlightFeature private constructor(
"travel",
"Core ➜ Fast Travels Unlocked",
taskOnlyCompleteOncePattern,
- { HypixelCommands.wiki("MUSEUM_TRAVEL_SCROLL") }, // The items do not have proper internal names and using the fact that all travel scrolls lead to the same wiki page
+ {
+ HypixelCommands.wiki("MUSEUM_TRAVEL_SCROLL")
+ }, // The items do not have proper internal names and using the fact that all travel scrolls lead to the same wiki page
openWikiTooltip
)
SkyblockGuideHighlightFeature(
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt
index adc932cce..b5c3c6ab4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt
@@ -79,7 +79,8 @@ object CraftMaterialsFromBazaar {
listOf("§eClick here to buy the items from bazaar!"),
onClick = {
getFromBazaar(neededMaterials)
- })
+ }
+ )
)
}
}
@@ -109,9 +110,14 @@ object CraftMaterialsFromBazaar {
val priceMultiplier = amount * multiplier
val text = "§8${priceMultiplier.addSeparators()}x " + material.itemName +
" §6${(material.getPrice() * priceMultiplier).shortFormat(false)}"
- add(Renderable.optionalLink(text, onClick = {
- BazaarApi.searchForBazaarItem(material, priceMultiplier)
- }))
+ add(
+ Renderable.optionalLink(
+ text,
+ onClick = {
+ BazaarApi.searchForBazaarItem(material, priceMultiplier)
+ }
+ )
+ )
}
add(
Renderable.clickAndHover(
@@ -120,7 +126,8 @@ object CraftMaterialsFromBazaar {
onClick = {
purchasing = false
display = emptyList()
- })
+ }
+ )
)
addMultipliers()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTooltip.kt
index 88ac9d474..01b42a130 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTooltip.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTooltip.kt
@@ -36,7 +36,7 @@ object ChocolateFactoryTooltip {
if (upgradeInfo.effectiveCost == null) return
event.toolTip.add("§7Extra: §6${upgradeInfo.extraPerSecond?.roundTo(2) ?: "N/A"} §7choc/s")
- event.toolTip.add("§7Effective Cost: §6${upgradeInfo.effectiveCost.addSeparators() ?: "N/A"}")
+ event.toolTip.add("§7Effective Cost: §6${upgradeInfo.effectiveCost.addSeparators()}")
if (slotIndex == ChocolateFactoryAPI.timeTowerIndex) {
event.toolTip.add("§7One charge will give: §6${chocPerTimeTower().addSeparators()}")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/craft/CraftableItemList.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/craft/CraftableItemList.kt
index 8612c9795..517a6fd6d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/craft/CraftableItemList.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/craft/CraftableItemList.kt
@@ -124,7 +124,9 @@ object CraftableItemList {
inInventory = false
}
- private fun pricePer(neededItems: Map<NEUInternalName, Int>): Double = neededItems.map { it.key.getPrice() * it.value }.sum()
+ private fun pricePer(neededItems: Map<NEUInternalName, Int>): Double = neededItems.map {
+ it.key.getPrice() * it.value
+ }.sum()
private fun canCraftAmount(
need: Map<NEUInternalName, Int>,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentationTableAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentationTableAPI.kt
index 9fcbbad0b..4965a9883 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentationTableAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentationTableAPI.kt
@@ -35,7 +35,9 @@ object ExperimentationTableAPI {
fun onInventoryUpdated(event: InventoryUpdatedEvent) {
if (LorenzUtils.skyBlockIsland != IslandType.PRIVATE_ISLAND || !inTable) return
- val entity = EntityUtils.getEntities<EntityArmorStand>().find { it.hasSkullTexture(EXPERIMENTATION_TABLE_SKULL) } ?: return
+ val entity = EntityUtils.getEntities<EntityArmorStand>().find {
+ it.hasSkullTexture(EXPERIMENTATION_TABLE_SKULL)
+ } ?: return
val vec = entity.getLorenzVec()
if (storage?.tablePos != vec) storage?.tablePos = vec
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairDataDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairDataDisplay.kt
index 37e12aa51..f67c7dcf8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairDataDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairDataDisplay.kt
@@ -174,9 +174,9 @@ object SuperpairDataDisplay {
// TODO extract logic in some way
if (it.value.any { data ->
(data.first?.index ?: -1).equalsOneOf(item.index, match.index) ||
- (data.second?.index
- ?: -1).equalsOneOf(item.index, match.index)
- }) {
+ (data.second?.index ?: -1).equalsOneOf(item.index, match.index)
+ }
+ ) {
return
}
}
@@ -199,12 +199,16 @@ object SuperpairDataDisplay {
key.isAnyOf(FoundType.MATCH, FoundType.PAIR) -> {
if (value.any { data ->
item.index.equalsOneOf(data.first?.index ?: -1, data.second?.index ?: -1)
- }) return
+ }
+ ) return
}
- else -> if (value.any { data ->
- (data.item?.index ?: -1) == item.index && data.item?.sameAs(item) == true
- }) return
+ else ->
+ if (
+ value.any { data ->
+ (data.item?.index ?: -1) == item.index && data.item?.sameAs(item) == true
+ }
+ ) return
}
}
@@ -293,7 +297,7 @@ object SuperpairDataDisplay {
slot >= experiment.endSlot ||
(if (experiment.sideSpace == 1) slot in sideSpaces1 else slot in sideSpaces2)
- private fun SuperpairItem?.sameAs(other: SuperpairItem) = this?.reward == other.reward && this?.damage == other.damage
+ private fun SuperpairItem?.sameAs(other: SuperpairItem) = this?.reward == other.reward && this.damage == other.damage
private fun isEnabled() = IslandType.PRIVATE_ISLAND.isInIsland() && config.superpairDisplay
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt
index 6c35eb5b1..379d3aa50 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt
@@ -47,14 +47,7 @@ object SuperpairsClicksAlert {
if (!targetInventoryNames.any { event.inventoryName.contains(it) }) return
if ( // checks if we have succeeded in either minigame
- (event.inventoryName.contains("Chronomatron") &&
- ((event.inventoryItems[4]?.displayName?.removeColor()
- ?.let { currentRoundRegex.find(it) }
- ?.groups?.get(1)?.value?.toInt() ?: -1) > roundsNeeded)) ||
- (event.inventoryName.contains("Ultrasequencer") &&
- event.inventoryItems.entries
- .filter { it.key < 45 }
- .any { it.value.stackSize > roundsNeeded })
+ isChronomatron(event) || isUltraSequencer(event)
) {
SoundUtils.playBeepSound()
ChatUtils.chat("You have reached the maximum extra Superpairs clicks from this add-on!")
@@ -62,6 +55,22 @@ object SuperpairsClicksAlert {
}
}
+ private fun isChronomatron(event: InventoryOpenEvent) =
+ event.inventoryName.contains("Chronomatron") &&
+ (
+ (
+ event.inventoryItems[4]?.displayName?.removeColor()?.let {
+ currentRoundRegex.find(it)
+ }?.groups?.get(1)?.value?.toInt() ?: -1
+ ) > roundsNeeded
+ )
+
+ private fun isUltraSequencer(event: InventoryUpdatedEvent) =
+ event.inventoryName.contains("Ultrasequencer") &&
+ event.inventoryItems.entries
+ .filter { it.key < 45 }
+ .any { it.value.stackSize > roundsNeeded }
+
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(46, "misc.superpairsClicksAlert", "inventory.helper.enchanting.superpairsClicksAlert")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
index ad2baedbe..0012ed8b0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt
@@ -366,9 +366,11 @@ object TunnelsMaps {
private fun toCompactGemstoneName(it: Map.Entry<String, List<GraphNode>>): Renderable = Renderable.clickAndHover(
Renderable.string(
- (it.key.getFirstColorCode()?.let { "§$it" } ?: "") + ("ROUGH_".plus(
- it.key.removeColor().removeSuffix("stone"),
- ).asInternalName().itemName.takeWhile { it != ' ' }.removeColor()),
+ (it.key.getFirstColorCode()?.let { "§$it" } ?: "") + (
+ "ROUGH_".plus(
+ it.key.removeColor().removeSuffix("stone"),
+ ).asInternalName().itemName.takeWhile { it != ' ' }.removeColor()
+ ),
horizontalAlign = RenderUtils.HorizontalAlignment.CENTER,
),
tips = listOf(it.key),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt
index 3e81a01a9..bc5e32440 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt
@@ -45,7 +45,11 @@ object CorpseTracker {
}
override fun getDescription(timesGained: Long): List<String> {
- val divisor = 1.coerceAtLeast(getSelectedBucket()?.let { corpsesLooted[it]?.toInt() } ?: corpsesLooted.sumAllValues().toInt())
+ val divisor = 1.coerceAtLeast(
+ getSelectedBucket()?.let {
+ corpsesLooted[it]?.toInt()
+ } ?: corpsesLooted.sumAllValues().toInt()
+ )
val percentage = timesGained.toDouble() / divisor
val dropRate = LorenzUtils.formatPercentage(percentage.coerceAtMost(1.0))
return listOf(
@@ -85,7 +89,9 @@ object CorpseTracker {
if (bucketData.getCorpseCount() == 0L) return@buildList
var profit = tracker.drawItems(bucketData, { true }, this)
- val applicableKeys: List<CorpseType> = bucketData.getSelectedBucket()?.let { listOf(it) } ?: enumValues<CorpseType>().toList()
+ val applicableKeys: List<CorpseType> = bucketData.getSelectedBucket()?.let {
+ listOf(it)
+ } ?: enumValues<CorpseType>().toList()
.filter { bucketData.corpsesLooted[it] != null }
var totalKeyCost = 0.0
var totalKeyCount = 0
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt
index a0545dc1c..67d54f10b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt
@@ -152,8 +152,8 @@ object MinionXp {
MinionFeatures.minionInventoryOpen -> {
addXpInfoToTooltip(event)
if (collectItem == event.itemStack.item) {
- collectItemXpList.forEachIndexed { i, it ->
- event.toolTip.add(i + 1, it)
+ collectItemXpList.forEachIndexed { i, item ->
+ event.toolTip.add(i + 1, item)
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
index a5062ee1d..7efce2fcd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt
@@ -260,7 +260,7 @@ object CarryTracker {
val totalCost = customer.carries.sumOf { it.getCost() ?: 0.0 }
val totalCostFormat = formatCost(totalCost)
if (totalCostFormat != "") {
- val paidFormat = "§6${customer.alreadyPaid.shortFormat()}"
+ val paidFormat = "§6${customer.alreadyPaid.shortFormat()}"
val missingFormat = formatCost(totalCost - customer.alreadyPaid)
list.add(
Renderable.clickAndHover(
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
index ffc260723..948ae70e0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt
@@ -157,12 +157,14 @@ object CollectionTracker {
itemAmount.percentWithColorCode(goalAmount, 1)
}§f)"
- display = Collections.singletonList(buildList {
- internalName?.let {
- add(it.getItemStack())
+ display = Collections.singletonList(
+ buildList {
+ internalName?.let {
+ add(it.getItemStack())
+ }
+ add("$itemName collection: §e$format$goal $gainText")
}
- add("$itemName collection: §e$format$goal $gainText")
- })
+ )
}
private fun countCurrentlyInInventory(): Int {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
index f8e5fbe32..ff5a5f7ac 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt
@@ -28,7 +28,8 @@ object JoinCrystalHollows {
if (message == "§cYou do not have an active Crystal Hollows pass!") {
lastWrongPassTime = System.currentTimeMillis()
if (!IslandType.DWARVEN_MINES.isInIsland()) {
- ChatUtils.clickableChat("Click here to warp to Dwarven Mines!",
+ ChatUtils.clickableChat(
+ "Click here to warp to Dwarven Mines!",
onClick = {
HypixelCommands.warp("mines")
}, "§eClick to run /warp mines!"
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt
index dc55af349..093c7d80e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt
@@ -23,7 +23,8 @@ object PrivateIslandNoPickaxeAbility {
if (event.itemInHand?.getItemCategoryOrNull()?.let {
ItemCategory.miningTools.contains(it)
- } == true) {
+ } == true
+ ) {
event.cancel()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordLocationKey.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordLocationKey.kt
index 895a04688..7f6caba24 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordLocationKey.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordLocationKey.kt
@@ -298,16 +298,12 @@ object DiscordLocationKey {
fun getDiscordIconKey(location: String): String {
val keyIfNormal = location.lowercase().replace(' ', '-')
- return if (normalRPC.contains(keyIfNormal)) {
- keyIfNormal
- } else if (specialRPC.containsKey(location)) {
- specialRPC[location]!!
- } else if (specialNetherRPC.contains(location)) {
- "crimson-isle"
- } else if (specialRiftRPC.containsKey(location)) {
- specialRiftRPC[location]!!
- } else {
- getAmbiguousKey(location) // will return skyblock-logo if not found
+ return when {
+ normalRPC.contains(keyIfNormal) -> keyIfNormal
+ specialRPC.containsKey(location) -> specialRPC[location] ?: getAmbiguousKey(location)
+ specialNetherRPC.contains(location) -> "crimson-isle"
+ specialRiftRPC.containsKey(location) -> specialRiftRPC[location] ?: getAmbiguousKey(location)
+ else -> getAmbiguousKey(location) // will return skyblock-logo if not found
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
index 16843ff6d..29f20fc05 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
@@ -120,21 +120,23 @@ object DiscordRPCManager : IPCListener {
private fun updatePresence() {
val location = DiscordStatus.LOCATION.getDisplayString()
val discordIconKey = DiscordLocationKey.getDiscordIconKey(location)
- client?.sendRichPresence(RichPresence.Builder().apply {
- setDetails(getStatusByConfigId(config.firstLine.get()).getDisplayString())
- setState(getStatusByConfigId(config.secondLine.get()).getDisplayString())
- setStartTimestamp(startTimestamp)
- setLargeImage(discordIconKey, location)
-
- if (config.showSkyCryptButton.get()) {
- addButton(
- RichPresenceButton(
- "https://sky.shiiyu.moe/stats/${LorenzUtils.getPlayerName()}/${HypixelData.profileName}",
- "Open SkyCrypt"
+ client?.sendRichPresence(
+ RichPresence.Builder().apply {
+ setDetails(getStatusByConfigId(config.firstLine.get()).getDisplayString())
+ setState(getStatusByConfigId(config.secondLine.get()).getDisplayString())
+ setStartTimestamp(startTimestamp)
+ setLargeImage(discordIconKey, location)
+
+ if (config.showSkyCryptButton.get()) {
+ addButton(
+ RichPresenceButton(
+ "https://sky.shiiyu.moe/stats/${LorenzUtils.getPlayerName()}/${HypixelData.profileName}",
+ "Open SkyCrypt"
+ )
)
- )
- }
- }.build())
+ }
+ }.build()
+ )
}
override fun onReady(client: IPCClient) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
index 82be48f80..708704d68 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordStatus.kt
@@ -163,7 +163,7 @@ enum class DiscordStatus(private val displayMessageSupplier: (() -> String?)) {
ITEM({
InventoryUtils.getItemInHand()?.let {
- String.format("Holding ${it.displayName.removeColor()}")
+ String.format(java.util.Locale.US, "Holding ${it.displayName.removeColor()}")
} ?: "No item in hand"
}),
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
index 5797c50cd..fb1ce6b44 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt
@@ -133,13 +133,15 @@ object EstimatedItemValueCalculator {
return Pair(totalPrice, basePrice)
}
- private fun isKuudraSet(internalName: String) = (kuudraSets.any { internalName.contains(it) } &&
- listOf(
- "CHESTPLATE",
- "LEGGINGS",
- "HELMET",
- "BOOTS",
- ).any { internalName.endsWith(it) })
+ private fun isKuudraSet(internalName: String) = (
+ kuudraSets.any { internalName.contains(it) } &&
+ listOf(
+ "CHESTPLATE",
+ "LEGGINGS",
+ "HELMET",
+ "BOOTS",
+ ).any { internalName.endsWith(it) }
+ )
private fun addAttributeCost(stack: ItemStack, list: MutableList<String>): Double {
val attributes = stack.getAttributes() ?: return 0.0
@@ -223,7 +225,9 @@ object EstimatedItemValueCalculator {
private fun getPriceOrCompositePriceForAttribute(attributeName: String, level: Int): Double? {
val intRange = if (config.useAttributeComposite.get()) 1..10 else level..level
return intRange.mapNotNull { lowerLevel ->
- "$attributeName;$lowerLevel".asInternalName().getPriceOrNull()?.let { it / (1 shl lowerLevel) * (1 shl level).toDouble() }
+ "$attributeName;$lowerLevel".asInternalName().getPriceOrNull()?.let {
+ it / (1 shl lowerLevel) * (1 shl level).toDouble()
+ }
}.minOrNull()
}
@@ -501,13 +505,13 @@ object EstimatedItemValueCalculator {
val tiers = mutableMapOf<NEUInternalName, Int>()
- for ((id, prices) in EssenceItemUtils.itemPrices) {
+ for ((id, _) in EssenceItemUtils.itemPrices) {
if (!id.contains(removed)) continue
tiers[id] = getKuudraTier(id)
}
- for ((id, tier) in tiers.sorted()) {
- val prices = EssenceItemUtils.itemPrices[id]!!
+ for ((id, _) in tiers.sorted()) {
+ val prices = EssenceItemUtils.itemPrices[id] ?: emptyMap()
maxStars += prices.size
if (remainingStars <= 0) continue
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantsJson.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantsJson.kt
index 99fb0b328..6e1550a97 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantsJson.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantsJson.kt
@@ -2,22 +2,26 @@ package at.hannibal2.skyhanni.features.misc.items.enchants
import at.hannibal2.skyhanni.features.misc.items.enchants.EnchantParser.enchantmentPattern
import com.google.gson.annotations.Expose
+import com.google.gson.annotations.SerializedName
class EnchantsJson {
@Expose
- var NORMAL: HashMap<String, Enchant.Normal> = hashMapOf()
+ @SerializedName("NORMAL")
+ var normal: HashMap<String, Enchant.Normal> = hashMapOf()
@Expose
- var ULTIMATE: HashMap<String, Enchant.Ultimate> = hashMapOf()
+ @SerializedName("ULTIMATE")
+ var ultimate: HashMap<String, Enchant.Ultimate> = hashMapOf()
@Expose
- var STACKING: HashMap<String, Enchant.Stacking> = hashMapOf()
+ @SerializedName("STACKING")
+ var stacking: HashMap<String, Enchant.Stacking> = hashMapOf()
fun getFromLore(passedLoreName: String): Enchant {
val loreName = passedLoreName.lowercase()
- var enchant: Enchant? = NORMAL[loreName]
- if (enchant == null) enchant = ULTIMATE[loreName]
- if (enchant == null) enchant = STACKING[loreName]
+ var enchant: Enchant? = normal[loreName]
+ if (enchant == null) enchant = ultimate[loreName]
+ if (enchant == null) enchant = stacking[loreName]
if (enchant == null) enchant = Enchant.Dummy(passedLoreName)
return enchant
}
@@ -29,13 +33,13 @@ class EnchantsJson {
if (enchants.isNotEmpty()) {
if (enchants.containsKey(enchant.nbtName)) return true
} else {
- if (NORMAL.containsKey(enchant.loreName.lowercase())) return true
- if (ULTIMATE.containsKey(enchant.loreName.lowercase())) return true
- if (STACKING.containsKey(enchant.loreName.lowercase())) return true
+ if (normal.containsKey(enchant.loreName.lowercase())) return true
+ if (ultimate.containsKey(enchant.loreName.lowercase())) return true
+ if (stacking.containsKey(enchant.loreName.lowercase())) return true
}
}
return false
}
- fun hasEnchantData() = NORMAL.isNotEmpty() && ULTIMATE.isNotEmpty() && STACKING.isNotEmpty()
+ fun hasEnchantData() = normal.isNotEmpty() && ultimate.isNotEmpty() && stacking.isNotEmpty()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt
index bfb8ce715..120c53e47 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt
@@ -144,8 +144,11 @@ object LimboTimeTracker {
fun printStats(onlyPlaytime: Boolean = false) {
val timeInLimbo: Int = if (inLimbo) limboJoinTime.passedSince().inWholeSeconds.toInt() else 0
- val playtime: Int = if (inLimbo) (storage?.playtime
- ?: 0) + limboJoinTime.passedSince().inWholeSeconds.toInt() else storage?.playtime ?: 0
+ val playtime: Int = if (inLimbo) (
+ storage?.playtime ?: 0
+ ) + limboJoinTime.passedSince().inWholeSeconds.toInt()
+ else storage?.playtime ?: 0
+
if (onlyPlaytime) {
ChatUtils.chat("§aYou have ${playtime / 3600} hours and ${playtime % 3600 / 60} minutes playtime!", false)
} else {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
index f87146a6f..745928cee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
@@ -76,8 +76,8 @@ object DefaultConfigFeatures {
return
}
optionList = optionList
- .mapValues { it ->
- it.value.filter {
+ .mapValues { option ->
+ option.value.filter {
(togglesInNewVersion == null || it.path in togglesInNewVersion) &&
(togglesInOldVersion == null || it.path !in togglesInOldVersion)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt
index 1ebbaed68..38ba952d5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigOptionGui.kt
@@ -107,19 +107,25 @@ class DefaultConfigOptionGui(
button("Turn all on", listOf()) {
for (entry in resetSuggestionState.entries) {
entry.setValue(ResetSuggestionState.TURN_ALL_ON)
- orderedOptions[entry.key]!!.forEach { it.toggleOverride = null }
+ orderedOptions[entry.key]?.let { opts ->
+ opts.forEach { it.toggleOverride = null }
+ }
}
}
button("Turn all off", listOf()) {
for (entry in resetSuggestionState.entries) {
entry.setValue(ResetSuggestionState.TURN_ALL_OFF)
- orderedOptions[entry.key]!!.forEach { it.toggleOverride = null }
+ orderedOptions[entry.key]?.let { opts ->
+ opts.forEach { it.toggleOverride = null }
+ }
}
}
button("Leave all untouched", listOf()) {
for (entry in resetSuggestionState.entries) {
entry.setValue(ResetSuggestionState.LEAVE_DEFAULTS)
- orderedOptions[entry.key]!!.forEach { it.toggleOverride = null }
+ orderedOptions[entry.key]?.let { opts ->
+ opts.forEach { it.toggleOverride = null }
+ }
}
}
button("Cancel", listOf()) {
@@ -165,12 +171,16 @@ class DefaultConfigOptionGui(
hoveringTextToDraw = listOf(
"§e${cat.name}",
"§7${cat.description}",
- ) + orderedOptions[cat]!!.map { "§7 - §a" + it.name }
+ ) + orderedOptions[cat]?.let { opts ->
+ opts.map { "§7 - §a" + it.name }
+ }.orEmpty()
}
if (shouldClick) {
resetSuggestionState[cat] = suggestionState.next
- orderedOptions[cat]!!.forEach { it.toggleOverride = null }
+ orderedOptions[cat]?.let { opts ->
+ opts.forEach { it.toggleOverride = null }
+ }
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
index 98b2d52a0..c555ec6d2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt
@@ -30,7 +30,8 @@ object AshfangNextResetCooldown {
if (EntityUtils.getEntities<EntityArmorStand>().any {
it.posY > 145 && (it.name.contains("§c§9Ashfang Acolyte§r") || it.name.contains("§c§cAshfang Underling§r"))
- }) {
+ }
+ ) {
spawnTime = SimpleTimeMark.now()
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
index 48fa8d03f..af82198bf 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
@@ -21,7 +21,7 @@ object RiftAPI {
val farmingTool by lazy { "FARMING_WAND".asInternalName() }
- private val blowgun by lazy { "BERBERIS_BLOWGUN".asInternalName() }
+ private val blowgun by lazy { "BERBERIS_BLOWGUN".asInternalName() }
val ItemStack?.isBlowgun: Boolean
get() = this?.getInternalName() == blowgun
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
index 50887554d..6b94919ee 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
@@ -56,7 +56,8 @@ object VoltHighlighter {
if (config.voltMoodMeter)
RenderLivingEntityHelper.setEntityColorWithNoHurtTime(
- entity, when (state) {
+ entity,
+ when (state) {
VoltState.FRIENDLY -> 0x8000FF00.toInt()
VoltState.DOING_LIGHTNING -> 0x800000FF.toInt()
VoltState.HOSTILE -> 0x80FF0000.toInt()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt
index 92e6c2014..516ecfd90 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt
@@ -131,7 +131,8 @@ object WoodenButtonsHelper {
blockState.getValue(BlockButtonWood.POWERED) == true &&
buttonLocation.canBeSeen(1..3) &&
lastHitButton != buttonLocation &&
- !hitButtons.contains(buttonLocation)) {
+ !hitButtons.contains(buttonLocation)
+ ) {
lastHitButton = buttonLocation
addLastHitButton()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
index 9c65a273e..913cfc4bf 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingMetalSuitProgress.kt
@@ -46,14 +46,18 @@ object LivingMetalSuitProgress {
if (config.compactWhenMaxed && isMaxed) return@buildList
for ((stack, progress) in progressMap.entries.reversed()) {
- add(buildList {
- add(" §7- ")
- add(stack)
- add("${stack.displayName}: ")
- add(progress?.let {
- drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}"
- } ?: "§cStart upgrading it!")
- })
+ add(
+ buildList {
+ add(" §7- ")
+ add(stack)
+ add("${stack.displayName}: ")
+ add(
+ progress?.let {
+ drawProgressBar(progress) + " §b${LorenzUtils.formatPercentage(progress)}"
+ } ?: "§cStart upgrading it!"
+ )
+ }
+ )
}
}
@@ -63,9 +67,12 @@ object LivingMetalSuitProgress {
val old = progressMap
progressMap = buildMap {
for (armor in InventoryUtils.getArmor().filterNotNull()) {
- put(armor, armor.getLivingMetalProgress()?.toDouble()?.let {
- it.coerceAtMost(100.0) / 100
- })
+ put(
+ armor,
+ armor.getLivingMetalProgress()?.toDouble()?.let {
+ it.coerceAtMost(100.0) / 100
+ }
+ )
}
}
if (old != progressMap) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
index ccb432f61..11de17b14 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt
@@ -90,7 +90,7 @@ object RiftBloodEffigies {
val split = hearts.split("§").drop(1)
for ((index, s) in split.withIndex()) {
- val time = effigiesTimes[index]!!
+ val time = effigiesTimes[index] ?: continue
if (time.isInPast()) {
if (s == "7") {
@@ -131,7 +131,7 @@ object RiftBloodEffigies {
for ((index, location) in locations.withIndex()) {
val name = "Effigy #${index + 1}"
- val duration = effigiesTimes[index]!!
+ val duration = effigiesTimes[index] ?: continue
if (duration.isFarPast()) {
if (config.unknownTime) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
index 6fadfce8f..86ae6d096 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
@@ -124,7 +124,8 @@ object EnigmaSoulWaypoints {
it,
"$name Enigma Soul",
config.color.toChromaColor(),
- condition = { config.showPathFinder })
+ condition = { config.showPathFinder }
+ )
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
index 50ce7f2dc..022a808d0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
@@ -134,29 +134,31 @@ object ShowMotesNpcSellPrice {
val sorted = itemMap.toList().sortedByDescending { it.second.second }.toMap().toMutableMap()
for ((internalName, pair) in sorted) {
- newDisplay.add(buildList {
- val (index, value) = pair
- add(" §7- ")
- val stack = internalName.getItemStack()
- add(stack)
- val price = value.formatPrice()
- val valuePer = stack.motesNpcPrice() ?: continue
- val tips = buildList {
- add("§6Item: ${stack.displayName}")
- add("§6Value per: §d$valuePer Motes")
- add("§6Total in chest: §d${(value / valuePer).toInt()}")
- add("")
- add("§6Total value: §d$price coins")
- }
- add(
- Renderable.hoverTips(
- "§6${stack.displayName}: §b$price",
- tips,
- highlightsOnHoverSlots = index,
- stack = stack
+ newDisplay.add(
+ buildList {
+ val (index, value) = pair
+ add(" §7- ")
+ val stack = internalName.getItemStack()
+ add(stack)
+ val price = value.formatPrice()
+ val valuePer = stack.motesNpcPrice() ?: continue
+ val tips = buildList {
+ add("§6Item: ${stack.displayName}")
+ add("§6Value per: §d$valuePer Motes")
+ add("§6Total in chest: §d${(value / valuePer).toInt()}")
+ add("")
+ add("§6Total value: §d$price coins")
+ }
+ add(
+ Renderable.hoverTips(
+ "§6${stack.displayName}: §b$price",
+ tips,
+ highlightsOnHoverSlots = index,
+ stack = stack
+ )
)
- )
- })
+ }
+ )
}
val total = itemMap.values.fold(0.0) { acc, pair -> acc + pair.second }.formatPrice()
newDisplay.addAsSingletonList("§7Total price: §b$total")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
index 9a01a9729..ffee3eda4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt
@@ -297,16 +297,19 @@ object SkillProgress {
add("§6Total XP: §b${totalXp.addSeparators()}")
}
val nameColor = if (skill == activeSkill) "§2" else "§a"
- Renderable.hoverTips(buildString {
- append("$nameColor${skill.displayName} $level ")
- append("§7(")
- append("§b${currentXp.addSeparators()}")
- if (currentXpMax != 0L) {
- append("§6/")
- append("§b${currentXpMax.addSeparators()}")
- }
- append("§7)")
- }, tips)
+ Renderable.hoverTips(
+ buildString {
+ append("$nameColor${skill.displayName} $level ")
+ append("§7(")
+ append("§b${currentXp.addSeparators()}")
+ if (currentXpMax != 0L) {
+ append("§6/")
+ append("§b${currentXpMax.addSeparators()}")
+ }
+ append("§7)")
+ },
+ tips
+ )
}
}
}
@@ -376,7 +379,8 @@ object SkillProgress {
val session = xpInfo.timeActive.seconds.format(TimeUnit.HOUR)
add(
- Renderable.clickAndHover("§7Session: §e$session ${if (xpInfo.sessionTimerActive) "" else "§c(PAUSED)"}",
+ Renderable.clickAndHover(
+ "§7Session: §e$session ${if (xpInfo.sessionTimerActive) "" else "§c(PAUSED)"}",
listOf("§eClick to reset!"),
onClick = {
xpInfo.sessionTimerActive = false
@@ -421,45 +425,49 @@ object SkillProgress {
add(Renderable.itemStack(activeSkill.item, 1.0))
}
- add(Renderable.string(buildString {
- append("§b+${skill.lastGain} ")
-
- if (config.useSkillName.get())
- append("${activeSkill.displayName} ")
-
- val (barCurrent, barMax) =
- if (useCustomGoalLevel && customGoalConfig.enableInProgressBar)
- Pair(have, need)
- else if (config.overflowConfig.enableInProgressBar.get())
- Pair(skill.overflowCurrentXp, skill.overflowCurrentXpMax)
- else
- Pair(skill.currentXp, skill.currentXpMax)
-
- val barPercent = if (barMax == 0L) 100F else 100F * barCurrent / barMax
- skillExpPercentage = (barPercent.toDouble() / 100)
-
- val percent = if (currentXpMax == 0L) 100F else 100F * currentXp / currentXpMax
-
- if (config.usePercentage.get())
- append("§7(§6${percent.roundTo(2)}%§7)")
- else {
- if (currentXpMax == 0L)
- append("§7(§6${currentXp.addSeparators()}§7)")
- else
- append("§7(§6${currentXp.addSeparators()}§7/§6${currentXpMax.addSeparators()}§7)")
- }
+ add(
+ Renderable.string(
+ buildString {
+ append("§b+${skill.lastGain} ")
+
+ if (config.useSkillName.get())
+ append("${activeSkill.displayName} ")
+
+ val (barCurrent, barMax) =
+ if (useCustomGoalLevel && customGoalConfig.enableInProgressBar)
+ Pair(have, need)
+ else if (config.overflowConfig.enableInProgressBar.get())
+ Pair(skill.overflowCurrentXp, skill.overflowCurrentXpMax)
+ else
+ Pair(skill.currentXp, skill.currentXpMax)
+
+ val barPercent = if (barMax == 0L) 100F else 100F * barCurrent / barMax
+ skillExpPercentage = (barPercent.toDouble() / 100)
+
+ val percent = if (currentXpMax == 0L) 100F else 100F * currentXp / currentXpMax
+
+ if (config.usePercentage.get())
+ append("§7(§6${percent.roundTo(2)}%§7)")
+ else {
+ if (currentXpMax == 0L)
+ append("§7(§6${currentXp.addSeparators()}§7)")
+ else
+ append("§7(§6${currentXp.addSeparators()}§7/§6${currentXpMax.addSeparators()}§7)")
+ }
- if (config.showActionLeft.get() && percent != 100f) {
- append(" - ")
- val gain = skill.lastGain.formatDouble()
- val actionLeft = (ceil(currentXpMax.toDouble() - currentXp) / gain).toLong().addSeparators()
- if (skill.lastGain != "" && !actionLeft.contains("-")) {
- append("§6$actionLeft Left")
- } else {
- append("§6∞ Left")
+ if (config.showActionLeft.get() && percent != 100f) {
+ append(" - ")
+ val gain = skill.lastGain.formatDouble()
+ val actionLeft = (ceil(currentXpMax.toDouble() - currentXp) / gain).toLong().addSeparators()
+ if (skill.lastGain != "" && !actionLeft.contains("-")) {
+ append("§6$actionLeft Left")
+ } else {
+ append("§6∞ Left")
+ }
+ }
}
- }
- }))
+ )
+ )
}
private fun updateSkillInfo() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
index d2c161eba..cd6e7b2db 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt
@@ -217,7 +217,8 @@ object SlayerRngMeterDisplay {
if (SlayerAPI.latestSlayerCategory.let {
it.endsWith(" I") || it.endsWith(" II")
- }) {
+ }
+ ) {
return ""
}
val latestSlayerCategory = SlayerAPI.latestSlayerCategory
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt
index 72ab05195..dd63fdd96 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt
@@ -81,7 +81,11 @@ object EndermanSlayerFeatures {
}
}
- if (config.highlightNukekebi && entity.inventory.any { it?.getSkullTexture() == NUKEKUBI_SKULL_TEXTURE } && entity !in nukekubiSkulls) {
+ if (config.highlightNukekebi &&
+ entity.inventory.any {
+ it?.getSkullTexture() == NUKEKUBI_SKULL_TEXTURE
+ } && entity !in nukekubiSkulls
+ ) {
nukekubiSkulls.add(entity)
RenderLivingEntityHelper.setEntityColor(
entity,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
index 82d57cac6..2f1569654 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt
@@ -84,9 +84,7 @@ object HighlightPlaceableNpcs {
private fun isPlaceableNpc(lore: List<String>): Boolean {
// Checking if NPC & placeable
- if (lore.isEmpty() ||
- !(clickToSetPattern.matches(lore.last()) ||
- clickToSpawnPattern.matches(lore.last()))) {
+ if (lore.isEmpty() || !(clickToSetPattern.matches(lore.last()) || clickToSpawnPattern.matches(lore.last()))) {
return false
}