From e41b7e4bd2526950625b0d72f6cf1af0fb7f2224 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sun, 26 May 2024 11:38:17 +0200 Subject: [PATCH 1/5] Fix: Small Memory Leak (#1890) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../skyhanni/features/slayer/HideMobNames.kt | 17 ++++++++++------- .../features/summonings/SummoningSoulsName.kt | 15 +++++++++------ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt index 28b03f597272..c2534b02b590 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/HideMobNames.kt @@ -5,16 +5,18 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SkyHanniRenderEntityEvent import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.TimeLimitedCache import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern +import kotlin.time.Duration.Companion.minutes class HideMobNames { - private val lastMobName = mutableMapOf() - private val mobNamesHidden = mutableListOf() + private val lastMobName = TimeLimitedCache(2.minutes) + private val mobNamesHidden = mutableListOf() private val patterns = mutableListOf() init { @@ -56,19 +58,20 @@ class HideMobNames { if (!entity.hasCustomName()) return val name = entity.name - if (lastMobName.getOrDefault(entity, "abc") == name) { - if (entity in mobNamesHidden) { + val id = entity.entityId + if (lastMobName.getOrNull(id) == name) { + if (id in mobNamesHidden) { event.isCanceled = true } return } - lastMobName[entity] = name - mobNamesHidden.remove(entity) + lastMobName.put(id, name) + mobNamesHidden.remove(id) if (shouldNameBeHidden(name)) { event.isCanceled = true - mobNamesHidden.add(entity) + mobNamesHidden.add(id) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt index ce4a5e4066ce..cabd8dd4e6de 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt @@ -11,10 +11,12 @@ import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.RenderUtils.drawString +import at.hannibal2.skyhanni.utils.TimeLimitedCache import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.entity.EntityLiving import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.minutes class SummoningSoulsName { @@ -27,8 +29,8 @@ class SummoningSoulsName { "NjkxNzc4ZDVlOTU4NDAxNzAyMjdlYjllM2UyOTQzYmVhODUzOTI5Y2U5MjNjNTk4OWFkIgogICAgfQogIH0KfQ" private val souls = mutableMapOf() - private val mobsLastLocation = mutableMapOf() - private val mobsName = mutableMapOf() + private val mobsLastLocation = TimeLimitedCache(6.minutes) + private val mobsName = TimeLimitedCache(6.minutes) @SubscribeEvent fun onTick(event: LorenzTickEvent) { @@ -45,7 +47,7 @@ class SummoningSoulsName { if (entity.hasSkullTexture(texture)) { val soulLocation = entity.getLorenzVec() - val map = mutableMapOf() + val map = mutableMapOf() for ((mob, loc) in mobsLastLocation) { val distance = loc.distance(soulLocation) map[mob] = distance @@ -53,16 +55,17 @@ class SummoningSoulsName { val nearestMob = map.sorted().firstNotNullOfOrNull { it.key } if (nearestMob != null) { - souls[entity] = mobsName[nearestMob]!! + souls[entity] = mobsName.getOrNull(nearestMob)!! } } } for (entity in EntityUtils.getEntities()) { + val id = entity.entityId val consumer = entity.getNameTagWith(2, "§c❤") if (consumer != null && !consumer.name.contains("§e0")) { - mobsLastLocation[entity] = entity.getLorenzVec() - mobsName[entity] = consumer.name + mobsLastLocation.put(id, entity.getLorenzVec()) + mobsName.put(id, consumer.name) } } From a214c141696f054b79c6ac13cb309992e3ac95d1 Mon Sep 17 00:00:00 2001 From: Phoebe <77941535+catgirlseraid@users.noreply.github.com> Date: Sun, 26 May 2024 22:02:22 +1200 Subject: [PATCH 2/5] Update project dictionary (#1896) Co-authored-by: SeRaid <77941535+SeRaid743@users.noreply.github.com> Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Co-authored-by: Cal Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .gitignore | 1 + .idea/dictionaries/default_user.xml | 190 ++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) create mode 100644 .idea/dictionaries/default_user.xml diff --git a/.gitignore b/.gitignore index d79aeba45c9e..d773ef66d1f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/* !.idea/icon.svg +!.idea/dictionaries/default_user.xml .vscode/ run/ build/ diff --git a/.idea/dictionaries/default_user.xml b/.idea/dictionaries/default_user.xml new file mode 100644 index 000000000000..62935a97cd0d --- /dev/null +++ b/.idea/dictionaries/default_user.xml @@ -0,0 +1,190 @@ + + + + abiphone + agaricus + allinvite + apec + arachne + arachne's + ashfang + autopet + bacte + bandana + berberis + biome + bladesoul + blobbercysts + bloodfiend + bobber + bobber's + bonzo + bonzo's + bonzos + boop + bossbar + broodfather + cadycous + carrolyn + cata + chestplate + chocolatefactory + chronomatron + chumcap + coflnet + coords + cropie + crosshair + deathmite + deathmites + deathripper + demonlord + derpy + despawn + dicer + dreadfarm + dwarven + egglocator + einary + einary's + elitebot + enderman + endermen + endermite + enderstone + endstone + explosivity + fermento + firedust + firesale + firesales + getfromsacks + glacite + goldor + gratitudes + hatcessory + hideparticles + hoppity + hoppity's + horsezooka + hotbar + hotm + hoverable + hypixel + hypixel's + ichor + ingame + inquis + inquistiors + interp + jawbus + jerries + jerrypocalypse + jyrre + kaeso + keybind + keybinds + kindlebane + kismets + kloon + kuudra + laggy + lapis + larvas + lclick + lerp + livids + matriach + mawdredge + maxor + mcmod + millenia + miniboss + mirrorverse + mmclick + mobtracker + modid + moldfin + mooshroom + moul + moulberry + moulconfig + mouselocked + mouselowered + nametag + nametags + necron + neu's + npcs + nukekebi + nukekubi + odger + odonata + odonatas + opengenerowmenu + opti + oruo + packmaster + pickblock + pickonimbus + preinitialization + procs + pyrochaos + quazii + rclick + redstone + reindrake + renderable + renderables + revenant + riftstalker + robotron + sadan + sethome + shcopytranslation + shcropstartlocation + shlanedetection + shmarkplayer + shmouselock + shoutout + shulker + shwords + shworldedit + skeletor + skyblock + skyhanni + skyhanni's + skymall + skytils + skytils's + soopy + soopy's + soulweaver + sprayonator + stillgore + superboom + supercrafting + superlite + superpairs + tablist + terracottas + thaumaturgy + treasurite + tubulator + turbomax + twinclaws + typhoeus + ultrasequencer + unobtained + untrackable + vermins + viewrecipe + voidgloom + voidling + voltas + wikithis + wyld + yoggie + + + From ea1385c77ffa8b9a4f98811fbf3e767c30d9edf7 Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Sun, 26 May 2024 12:23:02 +0200 Subject: [PATCH 3/5] Fix Typos (#1897) --- .../hannibal2/skyhanni/config/ConfigManager.kt | 4 ++-- .../config/features/fishing/BarnTimerConfig.java | 2 +- .../chocolatefactory/ChocolateFactoryConfig.java | 4 ++-- .../inventory/helper/TiaRelayConfig.java | 2 +- .../features/itemability/ChickenHeadConfig.java | 2 +- .../compacttablist/AdvancedPlayerListConfig.java | 2 +- .../features/misc/cosmetic/ArrowTrailConfig.java | 2 +- .../java/at/hannibal2/skyhanni/data/QuiverAPI.kt | 2 +- .../skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 2 +- .../skyhanni/features/bingo/BingoAPI.kt | 2 +- .../features/bingo/card/goals/BingoGoal.kt | 2 +- .../skyhanni/features/chat/Translator.kt | 2 +- .../features/combat/mobs/AreaMiniBossFeatures.kt | 2 +- .../features/event/diana/DianaFixChat.kt | 4 ++-- .../features/event/diana/GriffinBurrowHelper.kt | 2 +- .../event/diana/GriffinBurrowParticleFinder.kt | 4 ++-- .../features/event/diana/SoopyGuessBurrow.kt | 16 ++++++++-------- .../features/fishing/ShowFishingItemName.kt | 4 ++-- .../features/garden/GardenOptimalSpeed.kt | 2 +- .../garden/visitor/VisitorRewardWarning.kt | 2 +- .../chocolatefactory/ChocolateFactoryStats.kt | 2 +- .../ChocolateFactoryTimeTowerManager.kt | 2 +- .../itemabilities/FireVeilWandParticles.kt | 2 +- .../abilitycooldown/ItemAbilityCooldown.kt | 2 +- .../mining/fossilexcavator/FossilExcavatorAPI.kt | 2 +- .../solver/FossilSolverDisplay.kt | 2 +- .../features/mining/mineshaft/CorpseAPI.kt | 2 +- .../misc/discordrpc/DiscordRPCManager.kt | 6 +++--- .../misc/visualwords/ModifyVisualWords.kt | 2 +- .../nether/ashfang/AshfangFreezeCooldown.kt | 2 +- .../rift/area/westvillage/VerminHighlighter.kt | 8 ++++---- .../mixins/init/BeforeForLoopInjectionPoint.java | 2 +- .../skyhanni/test/TestCopyBestiaryValues.kt | 2 +- .../test/command/CopyNearbyEntitiesCommand.kt | 2 +- .../at/hannibal2/skyhanni/utils/ChatUtils.kt | 2 +- .../at/hannibal2/skyhanni/utils/ColorUtils.kt | 2 +- .../hannibal2/skyhanni/utils/ConditionalUtils.kt | 4 ++-- .../at/hannibal2/skyhanni/utils/ItemUtils.kt | 4 ++-- .../at/hannibal2/skyhanni/utils/NumberUtil.kt | 2 +- .../at/hannibal2/skyhanni/utils/StringUtils.kt | 2 +- 40 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt index 5c85c97eca2b..f4f870b72615 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt @@ -216,7 +216,7 @@ class ConfigManager { } } - // Some position elements dont need config links as they dont have a config option. + // Some position elements don't need config links as they don't have a config option. private val ignoredMissingConfigLinks = listOf( // commands "features.garden.GardenConfig.cropSpeedMeterPos", @@ -292,7 +292,7 @@ class ConfigManager { run() } catch (e: Throwable) { e.printStackTrace() - LorenzUtils.shutdownMinecraft("Config is corrupt inside developement enviroment.") + LorenzUtils.shutdownMinecraft("Config is corrupt inside development environment.") } } else { run() diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java index 1cc46da6089b..c5992856ba5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java @@ -61,7 +61,7 @@ public class BarnTimerConfig { public boolean wormLimitAlert = true; @Expose - @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manualy") + @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manually") @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) public int manualResetTimer = Keyboard.KEY_NONE; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/chocolatefactory/ChocolateFactoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/chocolatefactory/ChocolateFactoryConfig.java index 3f86dfefe044..db49702d9c04 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/chocolatefactory/ChocolateFactoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/chocolatefactory/ChocolateFactoryConfig.java @@ -126,13 +126,13 @@ public class ChocolateFactoryConfig { public Position position = new Position(163, 160, false, true); @Expose - @ConfigOption(name = "Compact On Click", desc = "Compact the item toolip when clicking on the chocolate.") + @ConfigOption(name = "Compact On Click", desc = "Compact the item tooltip when clicking on the chocolate.") @ConfigEditorBoolean @FeatureToggle public boolean compactOnClick = true; @Expose - @ConfigOption(name = "Always Compact", desc = "Always Compact the item toolip on the chocolate. Requires the above option to be enabled.") + @ConfigOption(name = "Always Compact", desc = "Always Compact the item tooltip on the chocolate. Requires the above option to be enabled.") @ConfigEditorBoolean public boolean compactOnClickAlways = false; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/TiaRelayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/TiaRelayConfig.java index 16dfbb8ef2bc..c51707f4520c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/TiaRelayConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/helper/TiaRelayConfig.java @@ -8,7 +8,7 @@ public class TiaRelayConfig { @Expose - @ConfigOption(name = "Sound Puzzle Helper", desc = "Helps with solving the sound puzzle for Tia (The 9 Operator Chips to do maintainance for the Abiphone Network).") + @ConfigOption(name = "Sound Puzzle Helper", desc = "Helps with solving the sound puzzle for Tia (The 9 Operator Chips to do maintenance for the Abiphone Network).") @ConfigEditorBoolean @FeatureToggle public boolean soundHelper = true; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ChickenHeadConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ChickenHeadConfig.java index 68dce34a5814..ecae45026467 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ChickenHeadConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/itemability/ChickenHeadConfig.java @@ -10,7 +10,7 @@ public class ChickenHeadConfig { @Expose - @ConfigOption(name = "Checken Head Timer", desc = "Show the cooldown until the next time you can lay an egg with the Chicken Head.") + @ConfigOption(name = "Chicken Head Timer", desc = "Show the cooldown until the next time you can lay an egg with the Chicken Head.") @ConfigEditorBoolean @FeatureToggle public boolean displayTimer = false; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/compacttablist/AdvancedPlayerListConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/compacttablist/AdvancedPlayerListConfig.java index a7652967e5ef..d28f107fb726 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/compacttablist/AdvancedPlayerListConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/compacttablist/AdvancedPlayerListConfig.java @@ -81,7 +81,7 @@ public String toString() { public boolean useLevelColorForName = false; @Expose - @ConfigOption(name = "Bingo Rank Number", desc = "Show the number of the bingo rank next to the icon. Useful if you are not so familar with bingo.") + @ConfigOption(name = "Bingo Rank Number", desc = "Show the number of the bingo rank next to the icon. Useful if you are not so familiar with bingo.") @ConfigEditorBoolean public boolean showBingoRankNumber = false; diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/misc/cosmetic/ArrowTrailConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/misc/cosmetic/ArrowTrailConfig.java index 9195de6f8b3a..203b47075c66 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/misc/cosmetic/ArrowTrailConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/misc/cosmetic/ArrowTrailConfig.java @@ -15,7 +15,7 @@ public class ArrowTrailConfig { public boolean enabled = false; @Expose - @ConfigOption(name = "Hide Nonplayer Arrows", desc = "Only shows for arrows the player has shot.") + @ConfigOption(name = "Hide Non-player Arrows", desc = "Only shows for arrows the player has shot.") @ConfigEditorBoolean public boolean hideOtherArrows = true; diff --git a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt index c40b291e6cf8..f2e3a02ceba8 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt @@ -90,7 +90,7 @@ object QuiverAPI { "(?:§.)*You've added (?:§.)*(?.*) x(?.*) (?:§.)*to your quiver!" ) - // Bows that don't use the players arrows, checked using the SkyBlock Id + // Bows that don't use the players arrows, checked using the SkyBlock ID private val fakeBowsPattern by group.pattern("fakebows", "^(BOSS_SPIRIT_BOW|CRYPT_BOW)$") private val quiverInventoryNamePattern by group.pattern("quivername", "^Quiver$") private val quiverInventoryPattern by group.pattern( diff --git a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt index cd9465264362..db39e98c5357 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt @@ -68,7 +68,7 @@ object HypixelBazaarFetcher { } if (internalName.getItemStackOrNull() == null) { - // Items that exist in Hypixel's Bazaar API, but not in NEU repo (not visible in in the ingame bazaar). + // Items that exist in Hypixel's Bazaar API, but not in NEU repo (not visible in the ingame bazaar). // Should only include Enchants if (LorenzUtils.debug) println("Unknown bazaar product: $key/$internalName") diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt index ccfd85ef74da..afd4f43d800e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt @@ -52,7 +52,7 @@ object BingoAPI { add(" guide: '${goal.guide}'") add(" done: '${goal.done}'") add(" highlight: '${goal.highlight}'") - add(" communtyGoalPercentage: '${goal.communtyGoalPercentage}'") + add(" communityGoalPercentage: '${goal.communtyGoalPercentage}'") val hiddenGoalData = goal.hiddenGoalData add(" hiddenGoalData") add(" unknownTip: '${hiddenGoalData.unknownTip}'") diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/BingoGoal.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/BingoGoal.kt index 120e6611231e..daccd37e3b1f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/BingoGoal.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/goals/BingoGoal.kt @@ -26,7 +26,7 @@ class BingoGoal { lateinit var hiddenGoalData: HiddenGoalData @Expose - var communtyGoalPercentage: Double? = null + var communtyGoalPercentage: Double? = null // TODO fix typo (Needs changes inside of storage) override fun toString(): String = displayName } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt index e513871fe441..683fe1857001 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt @@ -20,7 +20,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.net.URLDecoder import java.net.URLEncoder -// TODO split into two classes: TranslatorCommand and GoogleTransaltor. only communicates via getTranslationFromEnglish and getTranslationToEnglish +// TODO split into two classes: TranslatorCommand and GoogleTranslator. only communicates via getTranslationFromEnglish and getTranslationToEnglish class Translator { private val messageContentRegex = Regex(".*: (.*)") diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt index 06802413abab..f64467203cc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/AreaMiniBossFeatures.kt @@ -123,7 +123,7 @@ class AreaMiniBossFeatures { LorenzVec(-565.0, 41.0, -307.1), LorenzVec(-573.2, 51.0, -353.4), ), - MILLENIA_AGED_BLAZE( + MILLENNIA_AGED_BLAZE( EntityBlaze::class.java, 30_000_000, LorenzColor.DARK_RED, 60, LorenzVec(-292.5, 97.0, -999.7), LorenzVec(-232.3, 77.0, -951.1), 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 04de77ce9c0d..9ba94fe86d52 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 @@ -34,7 +34,7 @@ class DianaFixChat { lastErrorTime = SimpleTimeMark.farPast() return } - // particles dont work if a valid target point is close + // particles don't work if a valid target point is close if (GriffinBurrowHelper.targetLocation != null) return val spadeUse = lastSpadeUse.passedSince() if (spadeUse <= 3.seconds) return @@ -71,7 +71,7 @@ class DianaFixChat { lastToggleMusicPrompt = SimpleTimeMark.now() ChatUtils.clickableChat( "§cError detecting Diana Guess! Changing the Particle Quality has not worked :( " + - "§eClick here to disable hypixel music!", + "§eClick here to disable hypixel music!", onClick = { hasSetToggleMusic = true HypixelCommands.toggleMusic() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index c1485bcad792..24bc891a8b98 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -232,7 +232,7 @@ object GriffinBurrowHelper { while (!isValidGround(gY)) { gY-- if (gY < 65) { - // no ground detected, find lowest block below air + // no ground detected, find the lowest block below air return null } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt index fc43cdd9563e..f2fc89c5b032 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt @@ -30,7 +30,7 @@ object GriffinBurrowParticleFinder { private val burrows = mutableMapOf() private var lastDugParticleBurrow: LorenzVec? = null - // This exist to detect the unlucky timing when the user opens a burrow before it gets fully deteced + // This exists to detect the unlucky timing when the user opens a burrow before it gets fully detected private var fakeBurrow: LorenzVec? = null @SubscribeEvent @@ -172,7 +172,7 @@ object GriffinBurrowParticleFinder { if (location == fakeBurrow) { fakeBurrow = null - // This exist to detect the unlucky timing when the user opens a burrow before it gets fully deteced + // This exists to detect the unlucky timing when the user opens a burrow before it gets fully detected tryDig(location, ignoreFound = true) return } 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 125bf718f7ae..73fbc21a5132 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 @@ -202,17 +202,17 @@ class SoopyGuessBurrow { val xOff = dist * sin(y) val zOff = dist * cos(y) - val dencity = 5 + val density = 5 - for (o in 0..dencity) { - lastPos[0] += xOff / dencity - lastPos[2] += zOff / dencity + for (o in 0..density) { + lastPos[0] += xOff / density + lastPos[2] += zOff / density - lastPos[1] += ySpeed * dist / dencity - lastPos2[1] += ySpeed * dist / dencity + lastPos[1] += ySpeed * dist / density + lastPos2[1] += ySpeed * dist / density - lastPos2[0] -= xOff / dencity - lastPos2[2] -= zOff / dencity + lastPos2[0] -= xOff / density + lastPos2[2] -= zOff / density pr1.add(lastPos.toLorenzVec()) pr2.add(lastPos2.toLorenzVec()) diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt index 2ce023100482..13bd451f7406 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ShowFishingItemName.kt @@ -33,7 +33,7 @@ class ShowFishingItemName { if (!isEnabled()) return for (entityItem in EntityUtils.getEntitiesNextToPlayer(15.0)) { val itemStack = entityItem.entityItem - // Hypixel sometimes replaces the bait item mid air with a stone + // Hypixel sometimes replaces the bait item midair with a stone if (itemStack.name.removeColor() == "Stone") continue var text = "" @@ -43,7 +43,7 @@ class ShowFishingItemName { if (itemStack.getSkullTexture() in cheapCoins) { text = "§6Coins" } else { - val name = itemStack.name.transformIf({isBait}) { "§7" + this.removeColor() } + val name = itemStack.name.transformIf({ isBait }) { "§7" + this.removeColor() } text += if (isBait) "§c§l- §r" else "§a§l+ §r" val size = itemStack.stackSize diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt index fd73ec730fec..fcd7fcf9f970 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -33,7 +33,7 @@ class GardenOptimalSpeed { /** * This speed value represents the walking speed, not the speed stat. - * blocks per second = 4.317 * speed / 100 + * Blocks per second = 4.317 * speed / 100 * * It has an absolute speed cap of 500, and items that normally increase the cap do not apply here: * (Black Cat pet, Cactus knife, Racing Helmet or Young Dragon Armor) 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 75d0af8bbb8e..b62f65cad486 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 @@ -68,7 +68,7 @@ class VisitorRewardWarning { return } - // all but shift clicktypes work for accepting visitor + // all but shift click types work for accepting visitor if (event.clickTypeEnum == GuiContainerEvent.ClickType.SHIFT) return if (isRefuseSlot) { VisitorAPI.changeStatus(visitor, VisitorAPI.VisitorStatus.REFUSED, "refused") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt index 87aa21023ca6..04bf1b595f8b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt @@ -57,7 +57,7 @@ object ChocolateFactoryStats { "§6${ChocolateFactoryTimeTowerManager.timeTowerCharges()}" } - val timeTowerFull = ChocolateFactoryTimeTowerManager.timeTowerFullTimemark() + val timeTowerFull = ChocolateFactoryTimeTowerManager.timeTowerFullTimeMark() val prestigeEstimate = ChocolateAmount.PRESTIGE.formattedTimeUntilGoal(ChocolateFactoryAPI.chocolateForPrestige) val chocolateUntilPrestigeCalculation = diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt index 695d1d48040f..530bd7558d6f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt @@ -123,7 +123,7 @@ object ChocolateFactoryTimeTowerManager { } } - fun timeTowerFullTimemark(): SimpleTimeMark { + fun timeTowerFullTimeMark(): SimpleTimeMark { val profileStorage = profileStorage ?: return SimpleTimeMark.farPast() if (timeTowerFull()) return SimpleTimeMark.farPast() val nextChargeDuration = SimpleTimeMark(profileStorage.nextTimeTower) diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index 8e6b92bed02f..f299d4e3c3e8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -43,7 +43,7 @@ class FireVeilWandParticles { if (event.clickType != ClickType.RIGHT_CLICK) return val internalName = event.itemInHand?.getInternalName() - if (AshfangFreezeCooldown.iscurrentlyFrozen()) return + if (AshfangFreezeCooldown.isCurrentlyFrozen()) return if (internalName == item) { lastClick = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index 9108962711f6..8e81ef16f1f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -178,7 +178,7 @@ class ItemAbilityCooldown { @SubscribeEvent fun onItemClick(event: ItemClickEvent) { - if (AshfangFreezeCooldown.iscurrentlyFrozen()) return + if (AshfangFreezeCooldown.isCurrentlyFrozen()) return handleItemClick(event.itemInHand) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt index 56b3242b938c..764bf1d6d4d8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt @@ -111,7 +111,7 @@ object FossilExcavatorAPI { */ ItemUtils.readItemAmount(group("item")) } ?: return - // Workaround: If it is a enchanted book, we assume it is a paleontologist I book + // Workaround: If it is an enchanted book, we assume it is a paleontologist I book if (pair.first.let { it == "§fEnchanted" || it == "§fEnchanted Book" }) { pair = "§9Paleontologist I" to pair.second } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt index 5ddf8b857990..49dade3fce8e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt @@ -184,7 +184,7 @@ object FossilSolverDisplay { if (!isEnabled()) return if (inExcavatorMenu) { - // render here so they can move it around. As if you press key while doing the excavator you lose the scrap + // Render here so they can move it around. As if you press key while doing the excavator you lose the scrap config.position.renderString("§eExcavator solver gui", posLabel = "Fossil Excavator Solver") return } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/CorpseAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/CorpseAPI.kt index db16e4d58214..28e24724d552 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/CorpseAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/mineshaft/CorpseAPI.kt @@ -75,7 +75,7 @@ class CorpseAPI { */ ItemUtils.readItemAmount(group("item")) } ?: return - // Workaround: If it is a enchanted book, we assume it is a paleontologist I book + // Workaround: If it is an enchanted book, we assume it is a paleontologist I book if (pair.first.let { it == "§fEnchanted" || it == "§fEnchanted Book" }) { // pair = "Paleontologist I" to pair.second pair = "§9Ice Cold I" to pair.second 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 ec022920c800..b132561ffc31 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 @@ -85,8 +85,8 @@ object DiscordRPCManager : IPCListener { logger.warn("Failed to connect to RPC!", ex) ChatUtils.clickableChat( "Discord Rich Presence was unable to start! " + - "This usually happens when you join SkyBlock when Discord is not started. " + - "Please run /shrpcstart to retry once you have launched Discord.", + "This usually happens when you join SkyBlock when Discord is not started. " + + "Please run /shrpcstart to retry once you have launched Discord.", onClick = { startCommand() } @@ -164,7 +164,7 @@ object DiscordRPCManager : IPCListener { @SubscribeEvent fun onTick(event: LorenzTickEvent) { - // the mod has already started the connection process. this variable is my way of running a function when + // The mod has already started the connection process. This variable is my way of running a function when // the player joins SkyBlock but only running it again once they join and leave. if (started || !isEnabled()) return if (LorenzUtils.inSkyBlock) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt index b0a9d651e1d7..8afc503dd045 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt @@ -45,7 +45,7 @@ object ModifyVisualWords { } } - // Disabled, as its only a novelty for 30 seconds and will annoy after that everyone. + // Disabled, as it's only a novelty for 30 seconds and will annoy after that everyone. /* if (LorenzUtils.isAprilFoolsDay && !FontRendererHook.cameFromChat && Random.nextDouble() < 0.02) { modifiedText = modifiedText.replace(reverseRegex) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt index 87ff3b5f0d0a..e1ac0aea0bc8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt @@ -52,7 +52,7 @@ object AshfangFreezeCooldown { } } - fun iscurrentlyFrozen(): Boolean { + fun isCurrentlyFrozen(): Boolean { val passedSince = lastHit.passedSince() val maxDuration = 3.seconds val duration = maxDuration - passedSince diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt index 534f8bc02b26..5cf2368f0ac3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt @@ -23,7 +23,7 @@ import kotlin.time.Duration.Companion.minutes class VerminHighlighter { private val config get() = RiftAPI.config.area.westVillage.verminHighlight - private val checkedEntites = TimeLimitedSet(1.minutes) + private val checkedEntities = TimeLimitedSet(1.minutes) // TODO repo private val fly = @@ -37,8 +37,8 @@ class VerminHighlighter { for (entity in EntityUtils.getEntities()) { val id = entity.entityId - if (id in checkedEntites) continue - checkedEntites.add(id) + if (id in checkedEntities) continue + checkedEntities.add(id) if (!isVermin(entity)) continue val color = config.color.get().toChromaColor().withAlpha(60) @@ -50,7 +50,7 @@ class VerminHighlighter { fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.color) { // running setEntityColorWithNoHurtTime() again - checkedEntites.clear() + checkedEntities.clear() } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/init/BeforeForLoopInjectionPoint.java b/src/main/java/at/hannibal2/skyhanni/mixins/init/BeforeForLoopInjectionPoint.java index 5316a8258fcb..c3b47e9ee4ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/init/BeforeForLoopInjectionPoint.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/init/BeforeForLoopInjectionPoint.java @@ -21,7 +21,7 @@ * } * } * - * Does not work for more complex instructions which call functions or do other operations inside of the for loop header. + * Does not work for more complex instructions which call functions or do other operations inside the for loop header. * Does not work for {@link java.util.Iterator iterators}. * *

Set the lvIndex arg to specify which lvIndex to search for when selecting the loop.

diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt index 76ebba30e07c..08d0322c55b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt @@ -22,7 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object TestCopyBestiaryValues { - class BestiarityObject { + class BestiarityObject { // TODO fix typo @Expose var name: String = "" diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt index 276e5477ab58..f50d4cb45506 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/CopyNearbyEntitiesCommand.kt @@ -235,7 +235,7 @@ object CopyNearbyEntitiesCommand { add("Name: ${mob.name}") add("Type: ${mob.mobType}") add("Base Entity: ${mob.baseEntity.asString()}") - add("Armorstand: ${mob.armorStand?.asString()}") + add("ArmorStand: ${mob.armorStand?.asString()}") if (mob.extraEntities.isNotEmpty()) { add("Extra Entities") addAll(mob.extraEntities.map { " " + it.asString() }) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt index 1448cd250b98..94cdc4f0d207 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt @@ -67,7 +67,7 @@ object ChatUtils { * Why deprecate this? Even if this message is descriptive for the user and the developer, * we don't want inconsistencies in errors, and we would need to search * for the code line where this error gets printed any way. - * so it's better to use the stack trace still. + * So it's better to use the stack trace still. * * @param message The message to be sent * diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt index b7dbce754332..52656f6ad44c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ColorUtils.kt @@ -5,7 +5,7 @@ import kotlin.math.max object ColorUtils { - /** transfer string colors from the config to java.awt.Color */ + /** Transfer string colors from the config to java.awt.Color */ fun String.toChromaColor() = Color(toChromaColorInt(), true) fun String.toChromaColorInt() = SpecialColour.specialToChromaRGB(this) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ConditionalUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ConditionalUtils.kt index 1ee91774b2fe..00aec1dc5f19 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ConditionalUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ConditionalUtils.kt @@ -5,8 +5,8 @@ import io.github.notenoughupdates.moulconfig.observer.Property object ConditionalUtils { - fun T.transformIf(condition: T.() -> Boolean, transofmration: T.() -> T) = - if (condition()) transofmration(this) else this + fun T.transformIf(condition: T.() -> Boolean, transformation: T.() -> T) = + if (condition()) transformation(this) else this fun T.conditionalTransform(condition: Boolean, ifTrue: T.() -> Any, ifFalse: T.() -> Any) = if (condition) ifTrue(this) else ifFalse(this) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index be314a03032a..90ef85025064 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -344,13 +344,13 @@ object ItemUtils { fun NEUInternalName.isRune(): Boolean = contains("_RUNE;") - // use when showing the item name to the user (in guis, chat message, etc), not for comparing + // use when showing the item name to the user (in guis, chat message, etc.), not for comparing val ItemStack.itemName: String get() = getInternalName().itemName val ItemStack.itemNameWithoutColor: String get() = itemName.removeColor() - // use when showing the item name to the user (in guis, chat message, etc), not for comparing + // use when showing the item name to the user (in guis, chat message, etc.), not for comparing val NEUInternalName.itemName: String get() = itemNameCache.getOrPut(this) { grabItemName() } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt index 5df1915c0226..d533dfc424b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt @@ -46,7 +46,7 @@ object NumberUtil { fun format(value: Number, preciseBillions: Boolean = false): String { @Suppress("NAME_SHADOWING") val value = value.toLong() - // Long.MIN_VALUE == -Long.MIN_VALUE so we need an adjustment here + // Long.MIN_VALUE == -Long.MIN_VALUE, so we need an adjustment here if (value == Long.MIN_VALUE) return format(Long.MIN_VALUE + 1, preciseBillions) if (value < 0) return "-" + format(-value, preciseBillions) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index 4e5bce0107e7..4e87646fea70 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -464,7 +464,7 @@ object StringUtils { } /** - * Removes starting and ending reset formattings that dont sever a benefit at all. + * Removes starting and ending reset formattings that don't sever a benefit at all. */ fun String.stripHypixelMessage(): String { var message = this From 80c414d629cba4029198dbafb23941109ad9511b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 26 May 2024 12:30:49 +0200 Subject: [PATCH 4/5] typo --- .../skyhanni/config/features/fishing/BarnTimerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java index c5992856ba5f..041c257c2fdb 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/fishing/BarnTimerConfig.java @@ -61,7 +61,7 @@ public class BarnTimerConfig { public boolean wormLimitAlert = true; @Expose - @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manually") + @ConfigOption(name = "Reset Timer Hotkey", desc = "Press this key to reset the timer manually.") @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) public int manualResetTimer = Keyboard.KEY_NONE; From e78e440df6c071b2023c19ea311305e643378fb4 Mon Sep 17 00:00:00 2001 From: Mikecraft1224 <85994411+Mikecraft1224@users.noreply.github.com> Date: Sun, 26 May 2024 13:30:19 +0200 Subject: [PATCH 5/5] Feature + Fix: Added new chat filters, Fixed: Healer Orb Pickup (#1750) --- .../features/chat/FilterTypesConfig.java | 7 +++++++ .../features/dungeon/MessageFilterConfig.java | 6 ++++++ .../skyhanni/features/chat/ChatFilter.kt | 19 +++++++++++++++++++ .../features/dungeon/DungeonChatFilter.kt | 3 +-- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java index 9b1d7db80f78..76fb716da2fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/chat/FilterTypesConfig.java @@ -99,6 +99,13 @@ public class FilterTypesConfig { @FeatureToggle public boolean factoryUpgrade = false; + @Expose + @ConfigOption(name = "Sacrifice", desc = "Hide sacrifice messages of other players.") + @ConfigEditorBoolean + @FeatureToggle + public boolean sacrifice = false; + + //TODO remove @Expose @ConfigOption(name = "Others", desc = "Hide other annoying messages.") diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java index 34fe05c52828..0bb6d0b88087 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dungeon/MessageFilterConfig.java @@ -6,6 +6,12 @@ import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; public class MessageFilterConfig { + @Expose + @ConfigOption(name = "Rare Drops", desc = "Hides the chat message when other players get rare drops from chests.") + @ConfigEditorBoolean + @FeatureToggle + public boolean rareDrops = false; + @Expose @ConfigOption(name = "Keys and Doors", desc = "Hides the chat message when picking up keys or opening doors in Dungeons.") @ConfigEditorBoolean diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index c02a769e5766..c183a142c85b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt @@ -355,6 +355,14 @@ class ChatFilter { "§7You will now produce §r§6.* Chocolate §r§7per click!".toPattern(), "§7You upgraded to §r§d.*?§r§7!".toPattern(), ) + /** + * REGEX-TEST: §c§lSACRIFICE! §r§6[MVP§r§d++§r§6] Mikecraft1224§r§f §r§eturned §r§6Young Dragon Boots §r§einto §r§d40 Dragon Essence§r§e! + * REGEX-TEST: §c§lBONUS LOOT! §r§eThey also received §r§5Ritual Residue §r§efrom their sacrifice! + */ + private val sacrificePatterns = listOf( + "§c§lSACRIFICE! (.*) §r§eturned (.*) §r§einto (.*) Dragon Essence§r§e!".toPattern(), + "§c§lBONUS LOOT! §r§eThey also received (.*) §r§efrom their sacrifice!".toPattern() + ) private val powderMiningMessages = listOf( "§aYou uncovered a treasure chest!", "§aYou received §r§f1 §r§aWishing Compass§r§a.", @@ -372,6 +380,13 @@ class ChatFilter { "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬", ) + /** + * REGEX-TEST: §6§lRARE REWARD! §r§bLeebys §r§efound a §r§6Recombobulator 3000 §r§ein their Obsidian Chest§r§e! + */ + private val rareDropsMessages = listOf( + "§6§lRARE REWARD! (.*) §r§efound a (.*) §r§ein their (.*) Chest§r§e!".toPattern() + ) + // &r&6Your &r&aMage &r&6stats are doubled because you are the only player using this class!&r private val soloClassPatterns = listOf( "§6Your §r§a(Healer|Mage|Berserk|Archer|Tank) §r§6stats are doubled because you are the only player using this class!".toPattern() @@ -405,6 +420,8 @@ class ChatFilter { "fire_sale" to fireSalePatterns, "event" to eventPatterns, "factory_upgrade" to factoryUpgradePatterns, + "sacrifice" to sacrificePatterns, + "rare_drops" to rareDropsMessages, "solo_class" to soloClassPatterns, "solo_stats" to soloStatsPatterns, "fairy" to fairyPatterns, @@ -465,8 +482,10 @@ class ChatFilter { config.eventLevelUp && (message.isPresent("event") || StringUtils.isEmpty(message)) -> "event" config.fireSale && (fireSalePattern.matches(message) || message.isPresent("fire_sale")) -> "fire_sale" config.factoryUpgrade && message.isPresent("factory_upgrade") -> "factory_upgrade" + config.sacrifice && message.isPresent("sacrifice") -> "sacrifice" generalConfig.hideJacob && !GardenAPI.inGarden() && anitaFortunePattern.matches(message) -> "jacob_event" generalConfig.hideSkyMall && !LorenzUtils.inMiningIsland() && skymallPerkPattern.matches(message) -> "skymall" + dungeonConfig.rareDrops && message.isPresent("rare_drops") -> "rare_drops" dungeonConfig.soloClass && DungeonAPI.inDungeon() && message.isPresent("solo_class") -> "solo_class" dungeonConfig.soloStats && DungeonAPI.inDungeon() && message.isPresent("solo_stats") -> "solo_stats" dungeonConfig.fairy && DungeonAPI.inDungeon() && message.isPresent("fairy") -> "fairy" diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt index 495ff56a916c..381e179db2af 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt @@ -130,8 +130,7 @@ class DungeonChatFilter { "§d(.*) the Fairy§r§f: You killed me! I'll revive you so that my death is not in vain!".toPattern(), "§d(.*) the Fairy§r§f: You killed me! I'll revive your friend §r(.*) §r§fso that my death is not in vain!".toPattern(), "§d(.*) the Fairy§r§f: Have a great life!".toPattern(), - "§c(.*) §r§eYou picked up a Ability Damage Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +§r§c(.*)% §r§eAbility Damage for §r§b10 §r§eseconds.".toPattern(), - "§c(.*) §r§eYou picked up a Damage Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +§r§c(.*)% §r§eDamage for §r§b10 §r§eseconds.".toPattern(), + "§c(.*) §r§eYou picked up a (.*) Orb from (.*) §r§ehealing you for §r§c(.*) §r§eand granting you +(.*)% §r§e(.*) for §r§b10 §r§eseconds.".toPattern(), "(.*) §r§ehas obtained §r§a§r§9Premium Flesh§r§e!".toPattern(), "§6§lRARE DROP! §r§9Beating Heart §r§b(.*)".toPattern(), "(.*) §r§ehas obtained §r§a§r§9Beating Heart§r§e!".toPattern()