From 7e75d8a468b110ba881cc2010f2d23083f5d91dc Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:23:37 -0400 Subject: [PATCH 01/14] Add back imports for detekt --- build.gradle.kts | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 71a882ac96bf..324d3bfd0e43 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,8 @@ import at.skyhanni.sharedvariables.versionString import net.fabricmc.loom.task.RunGameTask import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import io.gitlab.arturbosch.detekt.Detekt +import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask plugins { idea @@ -345,27 +347,27 @@ publishing.publications { } // Detekt: TODO: Uncomment this when we're ready to enforce -// detekt { -// buildUponDefaultConfig = true // preconfigure defaults -// config.setFrom(rootProject.layout.projectDirectory.file("detekt/detekt.yml")) // point to your custom config defining rules to run, overwriting default behavior -// baseline = file(layout.projectDirectory.file("detekt/baseline.xml")) // a way of suppressing issues before introducing detekt -// source.setFrom(project.sourceSets.named("main").map { it.allSource }) -// } -// -// tasks.withType().configureEach { -// reports { -// html.required.set(true) // observe findings in your browser with structure and code snippets -// xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins -// sarif.required.set(true) // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with GitHub Code Scanning -// md.required.set(true) // simple Markdown format -// } -// } -// -// tasks.withType().configureEach { -// jvmTarget = target.minecraftVersion.formattedJavaLanguageVersion -// outputs.cacheIf { false } // Custom rules won't work if cached -// } -// tasks.withType().configureEach { -// jvmTarget = target.minecraftVersion.formattedJavaLanguageVersion -// outputs.cacheIf { false } // Custom rules won't work if cached -// } +detekt { + buildUponDefaultConfig = true // preconfigure defaults + config.setFrom(rootProject.layout.projectDirectory.file("detekt/detekt.yml")) // point to your custom config defining rules to run, overwriting default behavior + baseline = file(layout.projectDirectory.file("detekt/baseline.xml")) // a way of suppressing issues before introducing detekt + source.setFrom(project.sourceSets.named("main").map { it.allSource }) +} + +tasks.withType().configureEach { + reports { + html.required.set(true) // observe findings in your browser with structure and code snippets + xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins + sarif.required.set(true) // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with GitHub Code Scanning + md.required.set(true) // simple Markdown format + } +} + +tasks.withType().configureEach { + jvmTarget = target.minecraftVersion.formattedJavaLanguageVersion + outputs.cacheIf { false } // Custom rules won't work if cached +} +tasks.withType().configureEach { + jvmTarget = target.minecraftVersion.formattedJavaLanguageVersion + outputs.cacheIf { false } // Custom rules won't work if cached +} From f48988764ef725d2640a6f1494635fe9c6e22f6e Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:54:22 -0400 Subject: [PATCH 02/14] Add onlyIf --- build.gradle.kts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 324d3bfd0e43..887c64615bbc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -346,7 +346,6 @@ publishing.publications { } } -// Detekt: TODO: Uncomment this when we're ready to enforce detekt { buildUponDefaultConfig = true // preconfigure defaults config.setFrom(rootProject.layout.projectDirectory.file("detekt/detekt.yml")) // point to your custom config defining rules to run, overwriting default behavior @@ -355,6 +354,10 @@ detekt { } tasks.withType().configureEach { + onlyIf { + false // TODO: Remove onlyIf when we're ready to enforce + } + reports { html.required.set(true) // observe findings in your browser with structure and code snippets xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins From e41b8096d29d555a4b34e4dab5a699f0e0f1ec4c Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:57:37 -0400 Subject: [PATCH 03/14] Cleanup regressions --- .../hannibal2/skyhanni/features/event/hoppity/HoppityNpc.kt | 2 +- .../features/gui/customscoreboard/ScoreboardEvent.kt | 6 +++--- src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) 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 c120c3d649fd..c105a0abf227 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 @@ -60,7 +60,7 @@ object HoppityNpc { actionName = "warp to hub", action = { HypixelCommands.warp("hub") - //afterNextIslandwarpTtp hub: IslandGraphs.pathFind(hoppity) + // afterNextIslandwarpTtp hub: IslandGraphs.pathFind(hoppity) }, ) 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 ce4b5a4fafa9..1383b87a98a8 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 @@ -373,9 +373,9 @@ private fun getWinterLines() = buildList { } private fun getWinterShowWhen(): Boolean = getSbLines().any { - SbPattern.winterEventStartPattern.matches(it) - || (SbPattern.winterNextWavePattern.matches(it) && !it.endsWith("Soon!")) - || SbPattern.winterWavePattern.matches(it) + SbPattern.winterEventStartPattern.matches(it) || + (SbPattern.winterNextWavePattern.matches(it) && !it.endsWith("Soon!")) || + SbPattern.winterWavePattern.matches(it) } private fun getNewYearLines() = listOf(getSbLines().first { SbPattern.newYearPattern.matches(it) }) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index 198f7c0a00d0..281b744d657b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -38,6 +38,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent //#endif @SkyHanniModule +@Suppress("ImportOrdering") object EntityUtils { @Deprecated("Old. Instead use entity detection feature instead.") From b68df74a56042e3682452f69fbf706f411003c0a Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:57:55 -0400 Subject: [PATCH 04/14] Fix ModifierListSpacing issues --- .../at/hannibal2/skyhanni/utils/json/SkyHanniTypeAdapters.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/json/SkyHanniTypeAdapters.kt b/src/main/java/at/hannibal2/skyhanni/utils/json/SkyHanniTypeAdapters.kt index 13aec1d92b6a..968ad7fded97 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/json/SkyHanniTypeAdapters.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/json/SkyHanniTypeAdapters.kt @@ -84,9 +84,7 @@ object SkyHanniTypeAdapters { } } - inline - - fun GsonBuilder.registerTypeAdapter( + inline fun GsonBuilder.registerTypeAdapter( crossinline write: (JsonWriter, T) -> Unit, crossinline read: (JsonReader) -> T, ): GsonBuilder { From d8d40d68d713699b65dec09a2e23892fd66eecd6 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:58:31 -0400 Subject: [PATCH 05/14] Fix NoMultipleSpaces issues --- src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt | 2 +- .../skyhanni/features/event/hoppity/HoppityCollectionStats.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt index a763961f8b54..34f776308fda 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt @@ -126,7 +126,7 @@ object MobDetection { MobData.currentEntityLiving.clear() // Naturally removing the mobs using the despawn } - (MobData.currentEntityLiving - MobData.previousEntityLiving).forEach { addRetry(it) } // Spawn + (MobData.currentEntityLiving - MobData.previousEntityLiving).forEach { addRetry(it) } // Spawn (MobData.previousEntityLiving - MobData.currentEntityLiving).forEach { entityDeSpawn(it) } // Despawn MobData.notSeenMobs.removeIf(::canBeSeen) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt index 9fbb3e527dc0..7d2a6a457c28 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt @@ -213,7 +213,7 @@ object HoppityCollectionStats { val newItemStack = if (config.rarityDyeRecolor) ItemStack( Items.dye, 1, when (rarity) { - LorenzRarity.COMMON -> 7 // Light gray dye + LorenzRarity.COMMON -> 7 // Light gray dye LorenzRarity.UNCOMMON -> 10 // Lime dye LorenzRarity.RARE -> 4 // Lapis lazuli LorenzRarity.EPIC -> 5 // Purple dye From 1153a826ce55f861bec0f654e95737fad0f660fd Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:02:38 -0400 Subject: [PATCH 06/14] Fix NoSemicolons issues --- src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt | 2 +- .../skyhanni/features/bingo/card/goals/GoalType.kt | 1 - .../hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt | 1 - .../features/garden/farming/lane/FarmingDirection.kt | 1 - .../features/garden/farming/lane/FarmingLaneFeatures.kt | 1 - .../features/garden/visitor/GardenVisitorCompactChat.kt | 2 +- .../skyhanni/features/garden/visitor/VisitorAPI.kt | 2 +- .../at/hannibal2/skyhanni/features/inventory/ChestValue.kt | 2 -- .../skyhanni/features/inventory/QuickCraftFeatures.kt | 1 - .../hannibal2/skyhanni/features/inventory/SackDisplay.kt | 7 ++----- .../features/itemabilities/CrownOfAvariceCounter.kt | 2 +- .../features/mining/HighlightMiningCommissionMobs.kt | 1 - .../skyhanni/features/misc/NonGodPotEffectDisplay.kt | 1 - .../skyhanni/features/misc/discordrpc/DiscordStatus.kt | 1 - .../features/rift/area/dreadfarm/VoltHighlighter.kt | 4 ++-- .../skyhanni/features/slayer/SlayerMiniBossFeatures.kt | 1 - .../skyhanni/features/slayer/blaze/HellionShield.kt | 1 - .../java/at/hannibal2/skyhanni/utils/PrimitiveRecipe.kt | 1 - .../at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt | 1 - 19 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index e392699cdbfe..7581b3b1ec94 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -412,5 +412,5 @@ enum class SackStatus { MISSING, CORRECT, ALRIGHT, - OUTDATED; + OUTDATED, } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/GoalType.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/GoalType.kt index b2e4f6d8dfbc..6dd666d4e84d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/GoalType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/GoalType.kt @@ -3,5 +3,4 @@ package at.hannibal2.skyhanni.features.bingo.card.goals enum class GoalType { COMMUNITY, PERSONAL, - ; } 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 26e41f7eea89..6cbda5b04ca7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt @@ -38,7 +38,6 @@ object AnitaMedalProfit { GOLD("§6Gold medal", 8), SILVER("§fSilver medal", 2), BRONZE("§cBronze medal", 1), - ; } private fun getMedal(name: String) = MedalType.entries.firstOrNull { it.displayName == name } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingDirection.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingDirection.kt index 6ce5ebe06c11..06ff155b6cb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingDirection.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingDirection.kt @@ -3,5 +3,4 @@ package at.hannibal2.skyhanni.features.garden.farming.lane enum class FarmingDirection { NORTH_SOUTH, EAST_WEST, - ; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt index e407d0ad4deb..ce4ce6a9f8c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt @@ -49,7 +49,6 @@ object FarmingLaneFeatures { TOO_SLOW("§cToo slow!"), CALCULATING("§aCalculating.."), NORMAL(""), - ; } @HandleEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorCompactChat.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorCompactChat.kt index 52e49d26fe18..8cafd5260a1a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorCompactChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorCompactChat.kt @@ -56,7 +56,7 @@ object GardenVisitorCompactChat { ) private var visitorAcceptedChat = mutableListOf() - private var visitorNameFormatted = ""; + private var visitorNameFormatted = "" private var rewardsList = mutableListOf() @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt index d621aa081b37..1565d87d3eba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt @@ -201,7 +201,7 @@ object VisitorAPI { val pricePerCopper = pricePerCopper ?: error("pricePerCopper is null") val totalPrice = totalPrice ?: error("totalPrice is null") val totalReward = totalReward ?: error("totalReward is null") - val loss = totalPrice - totalReward; + val loss = totalPrice - totalReward return when { preventRefusing && hasReward() != null -> VisitorBlockReason.RARE_REWARD preventRefusingNew && offersAccepted == 0 -> VisitorBlockReason.NEVER_ACCEPTED diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt index bd032fe66cda..50c5e446fd20 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt @@ -230,13 +230,11 @@ object ChestValue { enum class SortType(val shortName: String, val longName: String) { PRICE_DESC("Price D", "Price Descending"), PRICE_ASC("Price A", "Price Ascending"), - ; } enum class FormatType(val type: String) { SHORT("Formatted"), LONG("Unformatted"), - ; } enum class DisplayType(val type: String) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt index 70069a84ea2a..f1235a968af8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt @@ -29,7 +29,6 @@ object QuickCraftFeatures { enum class InventoryType(val inventoryName: String) { CRAFT_ITEM("Craft Item"), MORE_QUICK_CRAFT_OPTIONS("Quick Crafting"), - ; } private fun InventoryType.ignoreSlot(slotNumber: Int?): Boolean = when (this) { 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 4856c65c10b7..1489ba83ff93 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt @@ -299,20 +299,17 @@ object SackDisplay { STORED_ASC("Stored A", "Stored Ascending"), PRICE_DESC("Price D", "Price Descending"), PRICE_ASC("Price A", "Price Ascending"), - ; } enum class PriceFormat(val displayName: String) { - FORMATED("Formatted"), - UNFORMATED("Unformatted"), - ; + FORMATTED("Formatted"), + UNFORMATTED("Unformatted"), } enum class NumberFormat(val displayName: String) { DEFAULT("Default"), FORMATTED("Formatted"), UNFORMATTED("Unformatted"), - ; } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/CrownOfAvariceCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/CrownOfAvariceCounter.kt index 207e1b92b6a1..df408133a136 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/CrownOfAvariceCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/CrownOfAvariceCounter.kt @@ -40,7 +40,7 @@ object CrownOfAvariceCounter { if (!config.enable) return null val item = InventoryUtils.getHelmet() if (item?.getInternalNameOrNull() != internalName) return null - val count = item.extraAttributes.getLong("collected_coins"); + val count = item.extraAttributes.getLong("collected_coins") return Renderable.horizontalContainer( listOf( Renderable.itemStack(internalName.getItemStack()), diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index cc9f6b7534ba..30c58d3725c2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -53,7 +53,6 @@ object HighlightMiningCommissionMobs { CH_GOBLIN_SLAYER("Goblin Slayer", { it.name == "Weakling " }), // new commissions - ; } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index 89db21304472..61f9a344923f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -76,7 +76,6 @@ object NonGodPotEffectDisplay { CURSE_OF_GREED("§4Curse of Greed I"), COLD_RESISTANCE_4("§bCold Resistance IV"), - ; } private val effectsCountPattern by RepoPattern.pattern( 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 47472d2fec20..82be48f80fa0 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 @@ -344,5 +344,4 @@ enum class AutoStatus(val placeholderText: String, val correspondingDiscordStatu STACKING("Stacking placeholder (should never be visible)", DiscordStatus.STACKING), DUNGEONS("Dungeons placeholder (should never be visible)", DiscordStatus.DUNGEONS), AFK("This person is not afk (should never be visible)", DiscordStatus.AFK), - ; } 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 77807e5bf176..1e40a3aefbfc 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 @@ -90,12 +90,12 @@ object VoltHighlighter { NO_VOLT, FRIENDLY, HOSTILE, - DOING_LIGHTNING, - ; + DOING_LIGHTNING } private fun getVoltState(itemStack: ItemStack): VoltState { return when (itemStack.getSkullTexture()) { + // TODO: Move these textures to the repo "ewogICJ0aW1lc3RhbXAiIDogMTY3Mzg4MzU3MjAzNSwKICAicHJvZmlsZUlkIiA6ICI0MDU4NDhjMmJjNTE0ZDhkOThkOTJkMGIwYzhiZDQ0YiIsCiAgInByb2ZpbGVOYW1lIiA6ICJMb3ZlT3dPIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2UxYjFiZmI1MzZiNjQxNmIyNmEyODNkMmQ4YWQ0YjE3NzFiYmU1Yjc2ODk2ZTI3MjdkNWU4MzNiYzg5NDk4MmQiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ==" -> { VoltState.DOING_LIGHTNING } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt index 0fd24e25c6d8..f2be28377ce3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt @@ -79,6 +79,5 @@ object SlayerMiniBossFeatures { SVEN(EntityWolf::class.java, 45_000, 120_000, 480_000), VOIDLING(EntityEnderman::class.java, 8_400_000, 17_500_000, 52_500_000), INFERNAL(EntityBlaze::class.java, 12_000_000, 25_000_000, 75_000_000), - ; } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShield.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShield.kt index db3826d4469e..290f006789c2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShield.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShield.kt @@ -14,5 +14,4 @@ enum class HellionShield( ASHEN("§8§lASHEN", "Ashen", LorenzColor.DARK_GRAY), SPIRIT("§f§lSPIRIT", "Spirit", LorenzColor.WHITE), CRYSTAL("§b§lCRYSTAL", "Crystal", LorenzColor.AQUA), - ; } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveRecipe.kt b/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveRecipe.kt index f064183ba372..24deb38a207d 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveRecipe.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveRecipe.kt @@ -49,5 +49,4 @@ enum class RecipeType { KAT_UPGRADE, ESSENCE, CRAFTING, - ; } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt index a6d42839cdb5..eea93de044e5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/tracker/SkyHanniTracker.kt @@ -198,7 +198,6 @@ open class SkyHanniTracker( TOTAL("Total"), SESSION("This Session"), MAYOR("This Mayor"), - ; } enum class DefaultDisplayMode(val display: String, val mode: DisplayMode?) { From a8aaf1d374f7ddf039f5510eef1da78705830fde Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:03:12 -0400 Subject: [PATCH 07/14] Fix NoTrailingSpaces issues --- .../features/event/lobby/waypoints/easter/EasterEggWaypoints.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt index 6831f1440115..8250b023db10 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EasterEggWaypoints.kt @@ -91,7 +91,7 @@ object EasterEggWaypoints { /* Title: §e§lHYPIXEL - + '§703/14/24 §8L30A' ' ' 'Rank: §bMVP§d+§b' From f29dcc09e51a95754bc32c35b9393c9edc617116 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:03:32 -0400 Subject: [PATCH 08/14] Fix regression --- .../skyhanni/features/event/hoppity/HoppityEggsManager.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index bdbe4cd7e10b..a69366931886 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -25,7 +25,6 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.now import at.hannibal2.skyhanni.utils.SkyBlockTime import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.TimeUtils.format -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Matcher import kotlin.time.Duration.Companion.minutes From 290f836dc8928199dae1ccdb37487e8193694096 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:04:53 -0400 Subject: [PATCH 09/14] Fix PropertyWrapping issues --- src/main/java/at/hannibal2/skyhanni/data/HotmData.kt | 3 ++- .../skyhanni/features/chat/PowderMiningChatFilter.kt | 3 ++- .../features/combat/ghostcounter/GhostCounter.kt | 3 ++- .../features/mining/powdertracker/PowderTracker.kt | 3 ++- .../features/misc/items/EstimatedItemValueCalculator.kt | 9 ++++++--- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt index 1d8182328b6e..3137458c3bec 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt @@ -421,7 +421,8 @@ enum class HotmData( val storage get() = ProfileStorageData.profileSpecific?.mining?.hotmTree - val abilities = listOf(PICKOBULUS, MINING_SPEED_BOOST, MANIAC_MINER, GEMSTONE_INFUSION, ANOMALOUS_DESIRE, SHEER_FORCE) + val abilities = + listOf(PICKOBULUS, MINING_SPEED_BOOST, MANIAC_MINER, GEMSTONE_INFUSION, ANOMALOUS_DESIRE, SHEER_FORCE) private val inventoryPattern by patternGroup.pattern( "inventory", diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt index d6e992738c67..c7f8e245d7cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt @@ -306,7 +306,8 @@ object PowderMiningChatFilter { return null } - private var rewardPatterns: Map, String> = emptyMap() + private var rewardPatterns: Map, String> = + emptyMap() @SubscribeEvent(priority = EventPriority.HIGHEST) fun onRepoReload(event: RepositoryReloadEvent) { 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 b337d58b1487..40e329f20cdf 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 @@ -71,7 +71,8 @@ object GhostCounter { val config get() = SkyHanniMod.feature.combat.ghostCounter val storage get() = ProfileStorageData.profileSpecific?.ghostCounter private var display = emptyList>() - var ghostCounterV3File = File(FilenameUtils.separatorsToSystem("./config/ChatTriggers/modules/GhostCounterV3/.persistantData.json")) + var ghostCounterV3File = + File(FilenameUtils.separatorsToSystem("./config/ChatTriggers/modules/GhostCounterV3/.persistantData.json")) private val patternGroup = RepoPattern.group("combat.ghostcounter") private val skillXPPattern by patternGroup.pattern( diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt index 2749404bef59..345efdf7804e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt @@ -140,7 +140,8 @@ object PowderTracker { } } - private val tracker = SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker }) { formatDisplay(drawDisplay(it)) } + private val tracker = + SkyHanniTracker("Powder Tracker", { Data() }, { it.powderTracker }) { formatDisplay(drawDisplay(it)) } class Data : TrackerData() { 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 2f58a4fd191f..62abb1c8c52a 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 @@ -742,9 +742,12 @@ object EstimatedItemValueCalculator { val map = mutableMapOf() // todo use repo - val tieredEnchants = listOf("compact", "cultivating", "champion", "expertise", "hecatomb", "toxophilite") - val onlyTierOnePrices = listOf("ultimate_chimera", "ultimate_fatal_tempo", "smoldering", "ultimate_flash", "divine_gift") - val onlyTierFivePrices = listOf("ferocious_mana", "hardened_mana", "mana_vampire", "strong_mana") + val tieredEnchants = + listOf("compact", "cultivating", "champion", "expertise", "hecatomb", "toxophilite") + val onlyTierOnePrices = + listOf("ultimate_chimera", "ultimate_fatal_tempo", "smoldering", "ultimate_flash", "divine_gift") + val onlyTierFivePrices = + listOf("ferocious_mana", "hardened_mana", "mana_vampire", "strong_mana") val internalName = stack.getInternalName() for ((rawName, rawLevel) in enchantments) { From 3c20fca081e9719d23e175578ad705b2e5f1d81a Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:05:37 -0400 Subject: [PATCH 10/14] Fix SpacingAroundComma issues --- src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt | 2 +- .../skyhanni/features/combat/damageindicator/BossType.kt | 4 ++-- .../features/rift/area/mirrorverse/RiftUpsideDownParkour.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 9da50e13eaba..4d7662b4f452 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -182,7 +182,7 @@ object GetFromSackAPI { if (!amountString.isDouble()) return CommandResult.WRONG_AMOUNT to null val itemString = arguments.dropLast(1).joinToString(" ").uppercase().replace(':', '-') - val replacedString = itemString.replace("_"," ") + val replacedString = itemString.replace("_", " ") val item = when { SackAPI.sackListInternalNames.contains(itemString) -> itemString.asInternalName() diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt index 3d46d3edc5d4..0d542df383b8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/BossType.kt @@ -21,7 +21,7 @@ enum class BossType( NETHER_VANQUISHER("§5Vanquisher", Type.VANQUISHER), END_ENDSTONE_PROTECTOR("§cEndstone Protector", Type.ENDERSTONE_PROTECTOR), - END_ENDER_DRAGON("Ender Dragon", Type.ENDER_DRAGON),// TODO fix totally + END_ENDER_DRAGON("Ender Dragon", Type.ENDER_DRAGON), // TODO fix totally SLAYER_ZOMBIE_1("§aRevenant Horror 1", Type.REVENANT_HORROR, "§aRev 1", showDeathTime = true), SLAYER_ZOMBIE_2("§eRevenant Horror 2", Type.REVENANT_HORROR, "§eRev 2", showDeathTime = true), @@ -107,7 +107,7 @@ enum class BossType( LEECH_SUPREME("§cLeech Supreme", Type.THE_RIFT_BOSSES), BACTE("§aBacte", Type.THE_RIFT_BOSSES), - WINTER_REINDRAKE("Reindrake", Type.REINDRAKE),// TODO fix totally + WINTER_REINDRAKE("Reindrake", Type.REINDRAKE), // TODO fix totally GARDEN_PEST_BEETLE("§cBeetle", Type.GARDEN_PESTS), GARDEN_PEST_CRICKET("§cCricket", Type.GARDEN_PESTS), diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt index ac12b43c00cd..c93932344d63 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt @@ -24,7 +24,7 @@ object RiftUpsideDownParkour { fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("RiftUpsideDownParkour") parkourHelper = ParkourHelper( - data.locations.map { it.add(-1.0, -1.0, -1.0) },// TODO remove offset. change repo instead + data.locations.map { it.add(-1.0, -1.0, -1.0) }, // TODO remove offset. change repo instead data.shortCuts, platformSize = 2.0, detectionRange = 2.0 From 8b319c48e7687b92d972d9b995fd46a66bcc6d50 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:11:16 -0400 Subject: [PATCH 11/14] Fix SpacingAroundCurly issuyes --- .../features/combat/mobs/MobHighlight.kt | 30 +++++++++---------- .../features/dungeon/DungeonHideItems.kt | 8 ++--- .../dungeon/HighlightDungeonDeathmite.kt | 6 ++-- .../frozentreasure/FrozenTreasureTracker.kt | 5 ++-- .../fishing/tracker/SeaCreatureTracker.kt | 5 ++-- .../garden/farming/ArmorDropTracker.kt | 5 ++-- .../garden/farming/DicerRngDropTracker.kt | 5 ++-- .../visitor/GardenVisitorDropStatistics.kt | 2 +- .../inventory/HideNotClickableItems.kt | 2 +- .../ChocolateFactoryStrayTracker.kt | 5 ++-- .../mining/HighlightMiningCommissionMobs.kt | 6 ++-- .../rift/area/westvillage/VerminTracker.kt | 5 ++-- .../features/slayer/SlayerMiniBossFeatures.kt | 6 ++-- .../skyhanni/features/slayer/SlayerType.kt | 2 +- .../skyhanni/utils/renderables/Renderable.kt | 1 + 15 files changed, 50 insertions(+), 43 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt index 7c33afcdb653..7d51994c029f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt @@ -42,8 +42,7 @@ object MobHighlight { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127) - ) - { config.corruptedMobHighlight } + ) { config.corruptedMobHighlight } } } @@ -57,16 +56,14 @@ object MobHighlight { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.DARK_BLUE.toColor().withAlpha(127) - ) - { config.arachneKeeperHighlight } + ) { config.arachneKeeperHighlight } } if (config.corleoneHighlighter && maxHealth == 1_000_000 && entity is EntityOtherPlayerMP && entity.name == "Team Treasurite") { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.DARK_PURPLE.toColor().withAlpha(127) - ) - { config.corleoneHighlighter } + ) { config.corleoneHighlighter } } if (entity is EntityEnderman) { @@ -78,8 +75,7 @@ object MobHighlight { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.DARK_AQUA.toColor().withAlpha(127) - ) - { config.zealotBruiserHighlighter } + ) { config.zealotBruiserHighlighter } } } @@ -89,8 +85,7 @@ object MobHighlight { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.GREEN.toColor().withAlpha(127) - ) - { config.chestZealotHighlighter } + ) { config.chestZealotHighlighter } } } @@ -99,8 +94,7 @@ object MobHighlight { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.DARK_RED.toColor().withAlpha(50) - ) - { config.specialZealotHighlighter } + ) { config.specialZealotHighlighter } } } @@ -153,12 +147,16 @@ object MobHighlight { } private fun markArachneMinis(entity: EntityLivingBase) { - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.GOLD.toColor().withAlpha(50)) - { config.arachneBossHighlighter } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.GOLD.toColor().withAlpha(50) + ) { config.arachneBossHighlighter } } private fun markArachne(entity: EntityLivingBase) { - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.RED.toColor().withAlpha(50)) - { config.arachneBossHighlighter } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.RED.toColor().withAlpha(50) + ) { config.arachneBossHighlighter } } } 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 f0ce80b1b18e..a5237aeb666a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -194,10 +194,10 @@ object DungeonHideItems { if (isSkeletonSkull(entity)) { movingSkeletonSkulls[entity] = System.currentTimeMillis() - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.GOLD.toColor().withAlpha(60)) - { - shouldColorMovingSkull(entity) - } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.GOLD.toColor().withAlpha(60) + ) { shouldColorMovingSkull(entity) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt index 26b129dd9574..15848a9bc859 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt @@ -21,8 +21,10 @@ object HighlightDungeonDeathmite { val maxHealth = event.maxHealth if (entity is EntitySilverfish && maxHealth == 1_000_000_000) { - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.DARK_RED.toColor().withAlpha(20)) - { SkyHanniMod.feature.dungeon.highlightDeathmites } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.DARK_RED.toColor().withAlpha(20) + ) { SkyHanniMod.feature.dungeon.highlightDeathmites } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt index 80812c4c563b..e41a61013210 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt @@ -42,8 +42,9 @@ object FrozenTreasureTracker { private var icePerSecond = mutableListOf() private var icePerHour = 0 private var stoppedChecks = 0 - private val tracker = SkyHanniTracker("Frozen Treasure Tracker", { Data() }, { it.frozenTreasureTracker }) - { formatDisplay(drawDisplay(it)) } + private val tracker = SkyHanniTracker("Frozen Treasure Tracker", { Data() }, { it.frozenTreasureTracker }) { + formatDisplay(drawDisplay(it)) + } init { FrozenTreasure.entries.forEach { it.chatPattern } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt index f050e56cdf95..ca8a73ce9d5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt @@ -28,8 +28,9 @@ object SeaCreatureTracker { private val config get() = SkyHanniMod.feature.fishing.seaCreatureTracker - private val tracker = SkyHanniTracker("Sea Creature Tracker", { Data() }, { it.fishing.seaCreatureTracker }) - { drawDisplay(it) } + private val tracker = SkyHanniTracker("Sea Creature Tracker", { Data() }, { it.fishing.seaCreatureTracker }) { + drawDisplay(it) + } class Data : TrackerData() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt index 90c68a046980..8a21525c1646 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt @@ -41,8 +41,9 @@ object ArmorDropTracker { private var hasArmor = false - private val tracker = SkyHanniTracker("Armor Drop Tracker", { Data() }, { it.garden.armorDropTracker }) - { drawDisplay(it) } + private val tracker = SkyHanniTracker("Armor Drop Tracker", { Data() }, { it.garden.armorDropTracker }) { + drawDisplay(it) + } class Data : TrackerData() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt index 9e9e3620b618..af74da0d7fb5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt @@ -31,8 +31,9 @@ object DicerRngDropTracker { private val itemDrops = mutableListOf() private val config get() = GardenAPI.config.dicerCounters - private val tracker = SkyHanniTracker("Dicer RNG Drop Tracker", { Data() }, { it.garden.dicerDropTracker }) - { drawDisplay(it) } + private val tracker = SkyHanniTracker("Dicer RNG Drop Tracker", { Data() }, { it.garden.dicerDropTracker }) { + drawDisplay(it) + } class Data : TrackerData() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 152fc1b7c23a..2ad6f56b1c05 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -196,7 +196,7 @@ object GardenVisitorDropStatistics { for (reward in VisitorReward.entries) { val count = rewardsCount[reward] ?: 0 - if (config.displayIcons) {// Icons + if (config.displayIcons) { // Icons val stack = reward.itemStack if (config.displayNumbersFirst) add(listOf("§b${count.addSeparators()} ", stack)) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 2e549313ce3a..f8a16bf50b0b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -311,7 +311,7 @@ object HideNotClickableItems { "BRACELET", ) for (type in list) { - if (stack.getLore().any { it.contains("§l") && it.contains(type) }) {// todo use item api + if (stack.getLore().any { it.contains("§l") && it.contains(type) }) { // todo use item api showGreenLine = true return false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt index 52a3c5f1bb3c..ea81d353fecd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt @@ -108,8 +108,9 @@ object ChocolateFactoryStrayTracker { "§7You caught a stray (?§.)Fish the Rabbit§7! §7You have already found (?:§.)?Fish the (?:§.)?Rabbit§7, so you received §6(?[\\d,]*) (?:§6)?Chocolate§7!", ) - private val tracker = SkyHanniTracker("Stray Tracker", { Data() }, { it.chocolateFactory.strayTracker }) - { drawDisplay(it) } + private val tracker = SkyHanniTracker("Stray Tracker", { Data() }, { it.chocolateFactory.strayTracker }) { + drawDisplay(it) + } class Data : TrackerData() { override fun reset() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 30c58d3725c2..071c905d53f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -66,8 +66,7 @@ object HighlightMiningCommissionMobs { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.YELLOW.toColor().withAlpha(127) - ) - { isEnabled() && type in active } + ) { isEnabled() && type in active } } } } @@ -98,8 +97,7 @@ object HighlightMiningCommissionMobs { RenderLivingEntityHelper.setEntityColorWithNoHurtTime( entity, LorenzColor.YELLOW.toColor().withAlpha(127) - ) - { isEnabled() && type in active } + ) { isEnabled() && type in active } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt index e47fe8002b6d..11a017a24297 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminTracker.kt @@ -56,8 +56,9 @@ object VerminTracker { private val config get() = RiftAPI.config.area.westVillage.verminTracker - private val tracker = SkyHanniTracker("Vermin Tracker", { Data() }, { it.rift.verminTracker }) - { drawDisplay(it) } + private val tracker = SkyHanniTracker("Vermin Tracker", { Data() }, { it.rift.verminTracker }) { + drawDisplay(it) + } class Data : TrackerData() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt index f2be28377ce3..4798a943257d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerMiniBossFeatures.kt @@ -43,8 +43,10 @@ object SlayerMiniBossFeatures { if (bossType.clazz != entity.javaClass) continue miniBosses = miniBosses.editCopy { add(entity) } - RenderLivingEntityHelper.setEntityColorWithNoHurtTime(entity, LorenzColor.AQUA.toColor().withAlpha(127)) - { config.slayerMinibossHighlight } + RenderLivingEntityHelper.setEntityColorWithNoHurtTime( + entity, + LorenzColor.AQUA.toColor().withAlpha(127) + ) { config.slayerMinibossHighlight } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt index 75b1efd34cf7..0a07e62fece0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerType.kt @@ -16,6 +16,6 @@ enum class SlayerType(val displayName: String, val rngName: String, val clazz: C ; companion object { - fun getByName(name: String): SlayerType? = entries.firstOrNull {name.contains(it.displayName)} + fun getByName(name: String): SlayerType? = entries.firstOrNull { name.contains(it.displayName) } } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt index f3f704f374a2..5362cc17794c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -1139,6 +1139,7 @@ interface Renderable { GlStateManager.translate(0f, yShift.toFloat(), 0f) renderY += yShift } + @Suppress("SpacingAroundCurly") val range = yOffsets.indexOfFirst { it >= scroll.asInt() }..<(yOffsets.indexOfFirst { it >= end }.takeIf { it > 0 } ?: yOffsets.size) - 1 From 3995674de047c483ce2d971b5c260bb9ee871cc1 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:11:37 -0400 Subject: [PATCH 12/14] Fix SpacingAroundOperators issues --- .../hannibal2/skyhanni/features/chat/ColorFormattingHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ColorFormattingHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ColorFormattingHelper.kt index 9c7c0380614b..2987d95a680e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ColorFormattingHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ColorFormattingHelper.kt @@ -21,7 +21,7 @@ object ColorFormattingHelper { "§f&k = Obfuscated (like this: §khellspawn§r)\n" + "§f&l = §lBold §r&m = §mStrikethrough \n" + "§f&o = §oItalic §r&n = §nUnderline\n" + - "§f&r = Reset\n"+ + "§f&r = Reset\n" + "§c===================================================" ) ) From ff329f5ce58b974a2ed19ad997208f208bacc7f7 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:12:02 -0400 Subject: [PATCH 13/14] Fix UnnecessaryParenthesesBeforeTrailingLambda issues --- .../at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index d6d79b31a710..dd9e3d91e9ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -111,7 +111,7 @@ object HarpFeatures { private fun updateScale() { if (Minecraft.getMinecraft().currentScreen == null) { - DelayedRun.runNextTick() { + DelayedRun.runNextTick { updateScale() } return From 1c24aee29582e6b3a244f8d7834e48d9bf0c27f5 Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:25:37 -0400 Subject: [PATCH 14/14] Add missing , --- .../skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1e40a3aefbfc..50887554dac0 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 @@ -90,7 +90,7 @@ object VoltHighlighter { NO_VOLT, FRIENDLY, HOSTILE, - DOING_LIGHTNING + DOING_LIGHTNING, } private fun getVoltState(itemStack: ItemStack): VoltState {