diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
30 files changed, 177 insertions, 70 deletions
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 0017e9098..1a8fde100 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 @@ -87,7 +87,7 @@ class EasterEggWaypoints { } // TODO use regex with the help of knowing the original lore. Will most likely need to wait until next egg event - + /* Title: §e§lHYPIXEL @@ -113,5 +113,6 @@ class EasterEggWaypoints { val c = ScoreboardData.sidebarLinesFormatted.any { it.contains("Easter Eggs") } return a && b && c } + private fun isEnabled() = HypixelData.hypixelLive && !LorenzUtils.inSkyBlock } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt index a369e405a..31663b403 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/easter/EggEntrances.kt @@ -8,10 +8,20 @@ enum class EggEntrances( vararg val easterEgg: EasterEgg, ) { - EASTER_EGG_ENTER_12_13_1_28_1("#12, #13, #28 (tunnel)", LorenzVec(126, 52, 175), EasterEgg.EASTER_EGG_12, EasterEgg.EASTER_EGG_13, EasterEgg.EASTER_EGG_28), + EASTER_EGG_ENTER_12_13_1_28_1( + "#12, #13, #28 (tunnel)", + LorenzVec(126, 52, 175), + EasterEgg.EASTER_EGG_12, + EasterEgg.EASTER_EGG_13, + EasterEgg.EASTER_EGG_28 + ), EASTER_EGG_ENTER_13_2("#13 (keep going, stay on your left [<--])", LorenzVec(144, 30, 19), EasterEgg.EASTER_EGG_13), EASTER_EGG_ENTER_13_3("#13 (enter here)", LorenzVec(107, 42, -47), EasterEgg.EASTER_EGG_13), - EASTER_EGG_ENTER_13_4("#13 (straight ahead, don't take the stairs)", LorenzVec(105, 49, -34), EasterEgg.EASTER_EGG_13), + EASTER_EGG_ENTER_13_4( + "#13 (straight ahead, don't take the stairs)", + LorenzVec(105, 49, -34), + EasterEgg.EASTER_EGG_13 + ), EASTER_EGG_ENTER_14_1("#14 (enter here)", LorenzVec(159, 68, -25), EasterEgg.EASTER_EGG_14), EASTER_EGG_ENTER_14_2("#14 (right turn [-->] here)", LorenzVec(153, 68, -8), EasterEgg.EASTER_EGG_14), EASTER_EGG_ENTER_14_3("#14 (left turn [<--] here)", LorenzVec(143, 68, -8), EasterEgg.EASTER_EGG_14), @@ -19,16 +29,34 @@ enum class EggEntrances( EASTER_EGG_ENTER_18_2("#18 (through this painting)", LorenzVec(142, 56, -82), EasterEgg.EASTER_EGG_18), EASTER_EGG_ENTER_21("#21 (through the waterfall)", LorenzVec(-137, 64, -82), EasterEgg.EASTER_EGG_21), EASTER_EGG_ENTER_28_2("#13, #28 (right turn [-->] here)", LorenzVec(94, 35, 145), EasterEgg.EASTER_EGG_28), - EASTER_EGG_ENTER_28_3("#13, #28 (straight ahead, stay on your right [-->])", LorenzVec(92, 21, 107), EasterEgg.EASTER_EGG_28), - EASTER_EGG_ENTER_29_2("#29 (straight ahead, stay on your right [-->])", LorenzVec(16, 32, 2), EasterEgg.EASTER_EGG_29), + EASTER_EGG_ENTER_28_3( + "#13, #28 (straight ahead, stay on your right [-->])", + LorenzVec(92, 21, 107), + EasterEgg.EASTER_EGG_28 + ), + EASTER_EGG_ENTER_29_2( + "#29 (straight ahead, stay on your right [-->])", + LorenzVec(16, 32, 2), + EasterEgg.EASTER_EGG_29 + ), EASTER_EGG_ENTER_29_3("#29 (enter here)", LorenzVec(54, 22, 60), EasterEgg.EASTER_EGG_29), EASTER_EGG_ENTER_29_4("#29 (up stairs, make left turn [<--])", LorenzVec(25, 25, 51), EasterEgg.EASTER_EGG_29), - EASTER_EGG_ENTER_29_5("#29 (up stairs, make left turn [<--] again)", LorenzVec(17, 32, 66), EasterEgg.EASTER_EGG_29), + EASTER_EGG_ENTER_29_5( + "#29 (up stairs, make left turn [<--] again)", + LorenzVec(17, 32, 66), + EasterEgg.EASTER_EGG_29 + ), EASTER_EGG_ENTER_29_6("#29 (left turn [<--] here)", LorenzVec(35, 37, 66), EasterEgg.EASTER_EGG_29), EASTER_EGG_ENTER_29_7("#29 (past this door)", LorenzVec(39, 37, 48), EasterEgg.EASTER_EGG_29), EASTER_EGG_ENTER_30_1("#30 (1st digit, SNEAK + RCLICK)", LorenzVec(143, 65, -30), EasterEgg.EASTER_EGG_30), EASTER_EGG_ENTER_30_2("#30 (3rd digit, open chest)", LorenzVec(205, 34, -157), EasterEgg.EASTER_EGG_30), - EASTER_EGG_ENTER_27_29_1_30_3("#27, #29, #30 (inside this well)", LorenzVec(10, 63, 0), EasterEgg.EASTER_EGG_27, EasterEgg.EASTER_EGG_29, EasterEgg.EASTER_EGG_30), + EASTER_EGG_ENTER_27_29_1_30_3( + "#27, #29, #30 (inside this well)", + LorenzVec(10, 63, 0), + EasterEgg.EASTER_EGG_27, + EasterEgg.EASTER_EGG_29, + EasterEgg.EASTER_EGG_30 + ), EASTER_EGG_ENTER_30_4("#30 (left turn [<--] here)", LorenzVec(-28, 42, 14), EasterEgg.EASTER_EGG_30), EASTER_EGG_ENTER_30_5("#30 Vault (brute force 2nd digit)", LorenzVec(-35, 25, 63), EasterEgg.EASTER_EGG_30), } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt index b0ff26ef0..3551898cd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt @@ -134,7 +134,6 @@ class TotemOfCorruption { } } - private fun createDisplay() = buildList { val totem = getTotemToShow() ?: return@buildList add("§5§lTotem of Corruption") diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt index ee9c4b44b..8337e367d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt @@ -27,7 +27,7 @@ class OdgerWaypoint { fun onTick(event: LorenzTickEvent) { if (!isEnabled() || !event.isMod(10)) return trophyFishInInventory = InventoryUtils.getItemsInOwnInventory() - .any { it.getItemCategoryOrNull() == ItemCategory.TROPHY_FISH } + .any { it.getItemCategoryOrNull() == ItemCategory.TROPHY_FISH } } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 3f81d5732..586829185 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -135,11 +135,12 @@ object FarmingFortuneDisplay { } private fun update() { - display = if (gardenJoinTime.passedSince() > 5.seconds && !foundTabUniversalFortune && !gardenJoinTime.isFarPast()) { - drawMissingFortuneDisplay(false) - } else if (firstBrokenCropTime.passedSince() > 10.seconds && !foundTabCropFortune && !firstBrokenCropTime.isFarPast()) { - drawMissingFortuneDisplay(true) - } else drawDisplay() + display = + if (gardenJoinTime.passedSince() > 5.seconds && !foundTabUniversalFortune && !gardenJoinTime.isFarPast()) { + drawMissingFortuneDisplay(false) + } else if (firstBrokenCropTime.passedSince() > 10.seconds && !foundTabCropFortune && !firstBrokenCropTime.isFarPast()) { + drawMissingFortuneDisplay(true) + } else drawDisplay() } private fun drawDisplay() = buildList { @@ -157,11 +158,13 @@ object FarmingFortuneDisplay { } } else getCurrentFarmingFortune() - list.add(Renderable.string( - "§6Farming Fortune§7: §e" + if (!recentlySwitchedTool && farmingFortune != -1.0) { - farmingFortune.round(0).addSeparators() - } else "§7" + (displayCrop.getLatestTrueFarmingFortune()?.addSeparators() ?: "?") - )) + list.add( + Renderable.string( + "§6Farming Fortune§7: §e" + if (!recentlySwitchedTool && farmingFortune != -1.0) { + farmingFortune.round(0).addSeparators() + } else "§7" + (displayCrop.getLatestTrueFarmingFortune()?.addSeparators() ?: "?") + ) + ) add(Renderable.horizontalContainer(list)) val ffReduction = getPestFFReduction() @@ -212,7 +215,7 @@ object FarmingFortuneDisplay { if (lastUniversalFortuneMissingError.passedSince() < 1.minutes) return ChatUtils.clickableChat( "§cCan not read Farming Fortune from tab list! Open /widget and enable the Stats Widget " + - "and showing the Farming Fortune stat.", + "and showing the Farming Fortune stat.", command = "widget" ) lastUniversalFortuneMissingError = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt index f233ab97f..1387aed1d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt @@ -29,6 +29,7 @@ class GardenCropMilestoneFix { "levelup", " {2}§r§b§lGARDEN MILESTONE §3(?<crop>.*) §8.*➜§3(?<tier>.*)" ) + /** * REGEX-TEST: §6§lRARE DROP! §9Mutant Nether Wart §6(§6+1,344☘) */ 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 ee856135f..f71b6dbb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt @@ -34,6 +34,7 @@ object GardenPlotAPI { "name", "§.Plot §7- §b(?<name>.*)" ) + /** * REGEX-TEST: §aThe Barn */ @@ -41,6 +42,7 @@ object GardenPlotAPI { "barnname", "§.(?<name>The Barn)" ) + /** * REGEX-TEST: §7Cleanup: §b0% Completed */ @@ -48,6 +50,7 @@ object GardenPlotAPI { "uncleaned", "§7Cleanup: .* (?:§.)*Completed" ) + /** * REGEX-TEST: §aUnlocked Garden §r§aPlot §r§7- §r§b10§r§a! */ @@ -55,6 +58,7 @@ object GardenPlotAPI { "chat.unlock", "§aUnlocked Garden §r§aPlot §r§7- §r§b(?<plot>.*)§r§a!" ) + /** * REGEX-TEST: §aPlot §r§7- §r§b10 §r§ais now clean! */ @@ -116,7 +120,20 @@ object GardenPlotAPI { val type: SprayType, ) - private fun Plot.getData() = GardenAPI.storage?.plotData?.getOrPut(id) { PlotData(id, "$id", 0, null, null, false, false, false, true, false) } + private fun Plot.getData() = GardenAPI.storage?.plotData?.getOrPut(id) { + PlotData( + id, + "$id", + 0, + null, + null, + false, + false, + false, + true, + false, + ) + } var Plot.name: String get() = getData()?.name ?: "$id" @@ -190,7 +207,7 @@ object GardenPlotAPI { fun Plot.isPlayerInside() = box.isPlayerInside() - fun closestCenterPlot(location: LorenzVec) = plots.find {it.box.isInside(location)}?.middle + fun closestCenterPlot(location: LorenzVec) = plots.find { it.box.isInside(location) }?.middle fun Plot.sendTeleportTo() { if (isBarn()) ChatUtils.sendCommandToServer("tptoplot barn") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt index 4bb5d7937..b7027beb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt @@ -161,7 +161,6 @@ object SensitivityReducer { isToggled = state } - fun doTheMath(input: Float, reverse: Boolean = false): Float { val divisor = config.reducingFactor.get() return if (!reverse) ((input - LOCKED) / divisor) + LOCKED 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 344e24466..0cafabd1c 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 @@ -47,7 +47,10 @@ open class FFGuideGUI : GuiScreen() { } 20 -> { - ChatUtils.chat("What do you mean with \"farming fortune\"? This is a web browser!", prefix = false) + ChatUtils.chat( + "What do you mean with \"farming fortune\"? This is a web browser!", + prefix = false + ) } 30 -> { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt index 02d8debc0..16d2e7594 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt @@ -1,6 +1,16 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide enum class FFTypes { - TOTAL, BASE, REFORGE, ABILITY, GREEN_THUMB, BASE_FF, ANITA, FARMING_LVL, COMMUNITY_SHOP, PLOTS, - CAKE, PET_ITEM -}
\ No newline at end of file + TOTAL, + BASE, + REFORGE, + ABILITY, + GREEN_THUMB, + BASE_FF, + ANITA, + FARMING_LVL, + COMMUNITY_SHOP, + PLOTS, + CAKE, + PET_ITEM, +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingItems.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingItems.kt index 4da76872b..f2bd6b360 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingItems.kt @@ -1,6 +1,26 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide enum class FarmingItems { - WHEAT, CARROT, POTATO, NETHER_WART, PUMPKIN, MELON, COCOA_BEANS, SUGAR_CANE, CACTUS, MUSHROOM, - HELMET, CHESTPLATE, LEGGINGS, BOOTS, NECKLACE, CLOAK, BELT, BRACELET, ELEPHANT, MOOSHROOM_COW, RABBIT, BEE -}
\ No newline at end of file + WHEAT, + CARROT, + POTATO, + NETHER_WART, + PUMPKIN, + MELON, + COCOA_BEANS, + SUGAR_CANE, + CACTUS, + MUSHROOM, + HELMET, + CHESTPLATE, + LEGGINGS, + BOOTS, + NECKLACE, + CLOAK, + BELT, + BRACELET, + ELEPHANT, + MOOSHROOM_COW, + RABBIT, + BEE, +} 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 c7c827b5b..9217f5eb6 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 @@ -54,8 +54,11 @@ class PestFinder { val plotName = plot.name val isInaccurate = plot.isPestCountInaccurate val pestsName = StringUtils.pluralize(pests, "pest") + val name = "§e" + if (isInaccurate) "1+?" else { + pests + } + " §c$pestsName §7in §b$plotName" val renderable = Renderable.clickAndHover( - "§e" + if (isInaccurate) "1+?" else {pests} + " §c$pestsName §7in §b$plotName", + name, listOf( "§7Pests Found: §e" + if (isInaccurate) "Unknown" else pests, "§7In plot §b$plotName", @@ -122,7 +125,8 @@ class PestFinder { val isInaccurate = plot.isPestCountInaccurate val location = playerLocation.copy(x = middle.x, z = middle.z) event.drawWaypointFilled(location, LorenzColor.RED.toColor()) - event.drawDynamicText(location, "§e" + if (isInaccurate) "?" else {pests} + " §c$pestsName §7in §b$plotName", 1.5) + 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/pests/PestSpawn.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt index 39dc22e5c..b8ef8a2d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt @@ -21,6 +21,7 @@ class PestSpawn { private val config get() = PestAPI.config.pestSpawn private val patternGroup = RepoPattern.group("garden.pests.spawn") + /** * REGEX-TEST: §6§lGROSS! §7A §6Pest §7has appeared in §aPlot §7- §b4§7! */ @@ -28,6 +29,7 @@ class PestSpawn { "one", "§6§l.*! §7A §6Pest §7has appeared in §aPlot §7- §b(?<plot>.*)§7!" ) + /** * REGEX-TEST: §6§lGROSS! §7A §6Pest §7has appeared in §aThe Barn§7! */ @@ -35,6 +37,7 @@ class PestSpawn { "onebarn", "§6§l.*! §7A §6Pest §7has appeared in §a(?<plot>The Barn)§7!" ) + /** * REGEX-TEST: §6§lEWW! §62 Pests §7have spawned in §aPlot §7- §b2§7! */ @@ -42,6 +45,7 @@ class PestSpawn { "multiple", "§6§l.*! §6(?<amount>\\d) Pests §7have spawned in §aPlot §7- §b(?<plot>.*)§7!" ) + /** * REGEX-TEST: §6§lEWW! §62 Pests §7have spawned in §aThe Barn§7! */ @@ -49,6 +53,7 @@ class PestSpawn { "multiplebarn", "§6§l.*! §6(?<amount>\\d) Pests §7have spawned in §a(?<plot>The Barn)§7!" ) + /** * REGEX-TEST: §6§lGROSS! §7While you were offline, §6Pests §7spawned in §aPlots §r§b12§r§7, §r§b9§r§7, §r§b5§r§7, §r§b11§r§7 and §r§b3§r§r§7! */ @@ -94,7 +99,7 @@ class PestSpawn { } offlinePestsSpawn.matchMatcher(message) { val plots = group("plots") - plotNames = plots.removeColor().split(", "," and ").toMutableList() + plotNames = plots.removeColor().split(", ", " and ").toMutableList() pestSpawn(0, plotNames, true) // blocked = true } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt index 9bf615828..a3c8f22dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt @@ -38,6 +38,7 @@ class StereoHarmonyDisplay { "select", "§aYou are now playing §r§e(?<type>.*)§r§a!" ) + /** * REGEX-TEST: §aYou are no longer playing §r§eNot Just a Pest§r§a! */ @@ -51,7 +52,7 @@ class StereoHarmonyDisplay { private val questionMarkSkull = ItemUtils.createSkull( "§c?", "28aa984a-2077-40cc-8de7-e641adf2c497", - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDZiY"+ + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDZiY" + "TYzMzQ0ZjQ5ZGQxYzRmNTQ4OGU5MjZiZjNkOWUyYjI5OTE2YTZjNTBkNjEwYmI0MGE1MjczZGM4YzgyIn19fQ==" ) 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 2031a2ff1..ab499f1ff 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 @@ -307,5 +307,9 @@ object GardenVisitorDropStatistics { } enum class VisitorRarity { - UNCOMMON, RARE, LEGENDARY, MYTHIC, SPECIAL, + UNCOMMON, + RARE, + LEGENDARY, + MYTHIC, + SPECIAL, } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 50779ac60..b86e580aa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -355,7 +355,7 @@ object GardenVisitorFeatures { } readingShoppingList = true - val finalList = toolTip.map { it.removePrefix("§5§o")}.toMutableList() + val finalList = toolTip.map { it.removePrefix("§5§o") }.toMutableList() var offset = 0 for ((i, formattedLine) in finalList.toMutableList().withIndex()) { val index = i + offset diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt index a3afd06ab..e2343af02 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt @@ -55,10 +55,14 @@ class GardenVisitorSupercraft { } fun getSupercraftForSacks(internalName: NEUInternalName, amount: Int) { - val ingredients = NEUItems.getRecipes(internalName).first { !it.ingredients.first().internalItemId.contains("PEST") }.ingredients + val ingredients = NEUItems.getRecipes(internalName) + // TODO describe what this line does + .first { !it.ingredients.first().internalItemId.contains("PEST") } + .ingredients val ingredientReqs = mutableMapOf<String, Int>() for (ingredient in ingredients) { - ingredientReqs[ingredient.internalItemId] = ingredientReqs.getOrDefault(ingredient.internalItemId, 0) + ingredient.count.toInt() + val key = ingredient.internalItemId + ingredientReqs[key] = ingredientReqs.getOrDefault(key, 0) + ingredient.count.toInt() } hasIngredients = true for ((key, value) in ingredientReqs) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt index 22d7f4784..1234dd435 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt @@ -50,7 +50,6 @@ class VisitorListener { private val logger = LorenzLogger("garden/visitors/listener") - companion object { private val VISITOR_INFO_ITEM_SLOT = 13 private val VISITOR_ACCEPT_ITEM_SLOT = 29 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt index 9edc2336f..41e1b59b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt @@ -40,7 +40,8 @@ class VisitorRewardWarning { } private fun renderColor(backgroundStack: ItemStack?, outlineStack: ItemStack?, outlineColor: LorenzColor) { - if (!config.bypassKey.isKeyHeld()) backgroundStack?.background = LorenzColor.DARK_GRAY.addOpacity(config.opacity).rgb + if (!config.bypassKey.isKeyHeld()) backgroundStack?.background = + LorenzColor.DARK_GRAY.addOpacity(config.opacity).rgb if (config.optionOutline) outlineStack?.borderLine = outlineColor.addOpacity(200).rgb } @@ -56,8 +57,8 @@ class VisitorRewardWarning { val isRefuseSlot = stack.name == "§cRefuse Offer" val isAcceptSlot = stack.name == "§aAccept Offer" - if (blockReason != null && !config.bypassKey.isKeyHeld() && - ((blockReason.blockRefusing && isRefuseSlot) || !blockReason.blockRefusing && isAcceptSlot)) { + val shouldBlock = blockReason?.run { blockRefusing && isRefuseSlot || !blockRefusing && isAcceptSlot } ?: false + if (!config.bypassKey.isKeyHeld() && shouldBlock) { event.isCanceled = true return } @@ -83,7 +84,7 @@ class VisitorRewardWarning { val isRefuseSlot = event.itemStack.name == "§cRefuse Offer" val isAcceptSlot = event.itemStack.name == "§aAccept Offer" - val blockReason = visitor.blockReason?: return + val blockReason = visitor.blockReason ?: return if (blockReason.blockRefusing && !isRefuseSlot) return if (!blockReason.blockRefusing && !isAcceptSlot) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt index 78f0ed6d4..329b09f0e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt +++ b/ |
