diff options
| author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-21 07:39:24 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-20 23:39:24 +0200 |
| commit | d534f73b63578d384c7a69462ca18cf0883926f5 (patch) | |
| tree | 80e21e1f0ec41c5dee47712c5d2144281afeb0e7 /src/main/java/at/hannibal2/skyhanni/features | |
| parent | 6410dcf999a08d4b6625fdc25f2db148c9df8338 (diff) | |
| download | skyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.tar.gz skyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.tar.bz2 skyhanni-d534f73b63578d384c7a69462ca18cf0883926f5.zip | |
Backend: Remove deprecated function ChatUtils.error (#2021)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
6 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt index 7da6d6704..baacbfa43 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghostcounter/GhostUtil.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.features.combat.ghostcounter import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.roundToPrecision @@ -85,7 +86,7 @@ object GhostUtil { c.ctDataImported = true ChatUtils.chat("§aImported data successfully!") } else - ChatUtils.error("GhostCounterV3 ChatTriggers module not found!") + ErrorManager.skyHanniError("GhostCounterV3 ChatTriggers module not found!") } fun String.formatText(option: GhostData.Option) = formatText(option.getInt(), option.getInt(true)) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index d9539fe15..e9e4ebd5a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.diana.InquisitorFoundEvent import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy import at.hannibal2.skyhanni.utils.EntityUtils @@ -49,7 +50,7 @@ object InquisitorWaypointShare { "(?<party>§9Party §8> )?(?<playerName>.+)§f: §rx: (?<x>[^ ,]+),? y: (?<y>[^ ,]+),? z: (?<z>[^ ,]+)" ) - //Support for https://www.chattriggers.com/modules/v/inquisitorchecker + // Support for https://www.chattriggers.com/modules/v/inquisitorchecker /** * REGEX-TEST: §9Party §8> UserName§f: §rA MINOS INQUISITOR has spawned near [Foraging Island ] at Coords 1 2 3 */ @@ -108,7 +109,7 @@ object InquisitorWaypointShare { inquisitorsNearby = emptyList() } - val inquisitorTime = mutableListOf<SimpleTimeMark>() + private val inquisitorTime = mutableListOf<SimpleTimeMark>() @HandleEvent fun onInquisitorFound(event: InquisitorFoundEvent) { @@ -194,14 +195,13 @@ object InquisitorWaypointShare { HypixelCommands.partyChat("Inquisitor dead!") } - fun sendInquisitor() { + private fun sendInquisitor() { if (!isEnabled()) return if (lastShareTime.passedSince() < 5.seconds) return lastShareTime = SimpleTimeMark.now() if (inquisitor == -1) { - ChatUtils.error("No Inquisitor Found!") - return + ErrorManager.skyHanniError("No Inquisitor Found!") } val inquisitor = EntityUtils.getEntityByID(inquisitor) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt index f7ca31109..d49de324c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt @@ -281,10 +281,9 @@ object PestAPI { } private fun removeNearestPest() { - val plot = getNearestInfestedPlot() ?: run { - ChatUtils.error("Can not remove nearest pest: No infested plots detected.") - return - } + val plot = getNearestInfestedPlot() + ?: ErrorManager.skyHanniError("Can not remove nearest pest: No infested plots detected.") + if (!plot.isPestCountInaccurate) plot.pests-- scoreboardPests-- updatePests() 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 f7944fcde..3fad28589 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -14,7 +14,7 @@ import at.hannibal2.skyhanni.features.mining.fossilexcavator.FossilExcavatorAPI import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.features.rift.RiftAPI.motesNpcPrice import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.equalsOneOf import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.InventoryUtils.getInventoryName @@ -134,7 +134,7 @@ object HideNotClickableItems { event.toolTip.add("") if (hideReason == "") { event.toolTip.add("§4No hide reason!") - ChatUtils.error("No hide reason for not clickable item!") + ErrorManager.skyHanniError("No hide reason for not clickable item!") } else { event.toolTip.add("§c$hideReason") if (config.itemsBypass && !hideReason.contains("SkyBlock Menu")) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt index f0722c8df..7ad645259 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt @@ -75,7 +75,7 @@ object TiaRelayHelper { val name = sounds.values.first().name for (sound in sounds.toMutableMap()) { if (sound.value.name != name) { - ChatUtils.error("Tia Relay Helper error: Too much background noise! Try turning off the music and then try again.") + ChatUtils.userError("Tia Relay Helper error: Too much background noise! Try turning off the music and then try again.") ChatUtils.clickableChat("Click here to run /togglemusic", onClick = { HypixelCommands.toggleMusic() }) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt index 20cd0bcdc..2741605ef 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt @@ -157,7 +157,7 @@ object QuickModMenuSwitch { } catch (_: Exception) { } } - ChatUtils.error("Error trying to open the gui for mod " + mod.name + "!") + ErrorManager.skyHanniError("Error trying to open the gui for mod " + mod.name + "!") } "hytil" -> { |
