summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJ10a1n15 <45315647+j10a1n15@users.noreply.github.com>2024-10-13 15:47:00 +0200
committerGitHub <noreply@github.com>2024-10-13 15:47:00 +0200
commit113389a86c769d4d3a547fac5b7440fa8f29bc6f (patch)
tree702537585f922d19a2cdfb94286c55568ccd21df /src/main/java
parentd8bb53773ba3f1e36e8822e58f3175c2847f7b61 (diff)
downloadskyhanni-113389a86c769d4d3a547fac5b7440fa8f29bc6f.tar.gz
skyhanni-113389a86c769d4d3a547fac5b7440fa8f29bc6f.tar.bz2
skyhanni-113389a86c769d4d3a547fac5b7440fa8f29bc6f.zip
Backend: Command Register Event (#2642)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/CommandBuilder.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/CommandCategory.kt44
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt1297
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/RegisterCommandsEvent.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.kt45
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/gui/ModifyWordsConfig.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt4
20 files changed, 886 insertions, 655 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 45d02f544..3aa57db32 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.config.ConfigFileType
import at.hannibal2.skyhanni.config.ConfigManager
import at.hannibal2.skyhanni.config.Features
import at.hannibal2.skyhanni.config.SackData
-import at.hannibal2.skyhanni.config.commands.Commands
+import at.hannibal2.skyhanni.config.commands.RegisterCommandsEvent
import at.hannibal2.skyhanni.data.OtherInventoryData
import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
@@ -59,7 +59,7 @@ class SkyHanniMod {
SkyHanniEvents.init(modules)
- Commands.init()
+ RegisterCommandsEvent.post()
PreInitFinishedEvent().post()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt
index ffb3b7256..2aad75a40 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigGuiManager.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.config
import at.hannibal2.skyhanni.SkyHanniMod
+import at.hannibal2.skyhanni.data.GuiEditManager
import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper
import io.github.notenoughupdates.moulconfig.gui.MoulConfigEditor
@@ -18,4 +19,16 @@ object ConfigGuiManager {
}
SkyHanniMod.screenToOpen = GuiScreenElementWrapper(editor)
}
+
+ fun onCommand(args: Array<String>) {
+ if (args.isNotEmpty()) {
+ if (args[0].lowercase() == "gui") {
+ GuiEditManager.openGuiPositionEditor(hotkeyReminder = true)
+ } else {
+ openConfigGui(args.joinToString(" "))
+ }
+ } else {
+ openConfigGui()
+ }
+ }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/CommandBuilder.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/CommandBuilder.kt
new file mode 100644
index 000000000..98227fc8c
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/CommandBuilder.kt
@@ -0,0 +1,20 @@
+package at.hannibal2.skyhanni.config.commands
+
+class CommandBuilder(val name: String) {
+ var description: String = ""
+ var category: CommandCategory = CommandCategory.MAIN
+ var aliases: List<String> = emptyList()
+ private var autoComplete: ((Array<String>) -> List<String>) = { listOf() }
+ private var callback: (Array<String>) -> Unit = {}
+
+ fun callback(callback: (Array<String>) -> Unit) {
+ this.callback = callback
+ }
+
+ fun autoComplete(autoComplete: (Array<String>) -> List<String>) {
+ this.autoComplete = autoComplete
+ }
+
+ fun toSimpleCommand() = SimpleCommand(name.lowercase(), aliases, callback, autoComplete)
+}
+
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/CommandCategory.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/CommandCategory.kt
new file mode 100644
index 000000000..b0474ae47
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/CommandCategory.kt
@@ -0,0 +1,44 @@
+package at.hannibal2.skyhanni.config.commands
+
+enum class CommandCategory(val color: String, val categoryName: String, val description: String) {
+ MAIN(
+ "§6",
+ "Main Command",
+ "Most useful commands of SkyHanni",
+ ),
+ USERS_ACTIVE(
+ "§e",
+ "Normal Command",
+ "Normal Command for everyone to use",
+ ),
+ USERS_RESET(
+ "§e",
+ "Normal Reset Command",
+ "Normal Command that resents some data",
+ ),
+ USERS_BUG_FIX(
+ "§f",
+ "User Bug Fix",
+ "A Command to fix small bugs",
+ ),
+ DEVELOPER_TEST(
+ "§5",
+ "Developer Test Commands",
+ "A Command to edit/test/change some features. §cIntended for developers only!",
+ ),
+ DEVELOPER_DEBUG(
+ "§9",
+ "Developer Debug Commands",
+ "A Command to debug/read/copy/monitor features. §cIntended for developers only!",
+ ),
+ INTERNAL(
+ "§8",
+ "Internal Command",
+ "A Command that should §cnever §7be called manually!",
+ ),
+ SHORTENED_COMMANDS(
+ "§b",
+ "Shortened Commands",
+ "Commands that shorten or improve existing Hypixel commands!",
+ )
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index c5a28679e..208beafe4 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -2,12 +2,11 @@ package at.hannibal2.skyhanni.config.commands
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.api.SkillAPI
+import at.hannibal2.skyhanni.api.event.HandleEvent
import at.hannibal2.skyhanni.config.ConfigFileType
import at.hannibal2.skyhanni.config.ConfigGuiManager
-import at.hannibal2.skyhanni.config.features.About.UpdateStream
import at.hannibal2.skyhanni.data.ChatManager
import at.hannibal2.skyhanni.data.GardenCropMilestonesCommunityFix
-import at.hannibal2.skyhanni.data.GuiEditManager
import at.hannibal2.skyhanni.data.PartyAPI
import at.hannibal2.skyhanni.data.SackAPI
import at.hannibal2.skyhanni.data.ScoreboardData
@@ -80,6 +79,7 @@ import at.hannibal2.skyhanni.features.misc.visualwords.VisualWordGui
import at.hannibal2.skyhanni.features.rift.area.westvillage.VerminTracker
import at.hannibal2.skyhanni.features.rift.everywhere.PunchcardHighlight
import at.hannibal2.skyhanni.features.slayer.SlayerProfitTracker
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.test.DebugCommand
import at.hannibal2.skyhanni.test.PacketTest
import at.hannibal2.skyhanni.test.SkyBlockIslandTest
@@ -97,638 +97,735 @@ import at.hannibal2.skyhanni.test.command.TrackParticlesCommand
import at.hannibal2.skyhanni.test.command.TrackSoundsCommand
import at.hannibal2.skyhanni.test.graph.GraphEditor
import at.hannibal2.skyhanni.utils.APIUtils
-import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ExtendedChatColor
import at.hannibal2.skyhanni.utils.ItemPriceUtils
-import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.TabListData
import at.hannibal2.skyhanni.utils.chat.ChatClickActionManager
import at.hannibal2.skyhanni.utils.repopatterns.RepoPatternGui
-import net.minecraft.command.ICommandSender
-import net.minecraft.util.BlockPos
-import net.minecraftforge.client.ClientCommandHandler
+@SkyHanniModule
object Commands {
- private val openMainMenu: (Array<String>) -> Unit = {
- if (it.isNotEmpty()) {
- if (it[0].lowercase() == "gui") {
- GuiEditManager.openGuiPositionEditor(hotkeyReminder = true)
- } else {
- ConfigGuiManager.openConfigGui(it.joinToString(" "))
- }
- } else {
- ConfigGuiManager.openConfigGui()
- }
- }
-
- // command -> description
- private val commands = mutableListOf<CommandInfo>()
-
- enum class CommandCategory(val color: String, val categoryName: String, val description: String) {
- MAIN("§6", "Main Command", "Most useful commands of SkyHanni"),
- USERS_NORMAL("§e", "Normal Command", "Normal Command for everyone to use"),
- USERS_BUG_FIX("§f", "User Bug Fix", "A Command to fix small bugs"),
- DEVELOPER_CODING_HELP(
- "§5",
- "Developer Coding Help",
- "A Command that can help with developing new features. §cIntended for developers only!",
- ),
- DEVELOPER_DEBUG_FEATURES(
- "§9",
- "Developer Debug Features",
- "A Command that is useful for monitoring/debugging existing features. §cIntended for developers only!",
- ),
- INTERNAL("§8", "Internal Command", "A Command that should §cnever §7be called manually!"),
- SHORTENED_COMMANDS("§b", "Shortened Commands", "Commands that shorten or improve existing Hypixel commands!")
- }
-
- class CommandInfo(val name: String, val description: String, val category: CommandCategory)
-
- private var currentCategory = CommandCategory.MAIN
-
- fun init() {
- currentCategory = CommandCategory.MAIN
- usersMain()
-
- currentCategory = CommandCategory.USERS_NORMAL
- usersNormal()
-
- currentCategory = CommandCategory.USERS_BUG_FIX
- usersBugFix()
-
- currentCategory = CommandCategory.DEVELOPER_CODING_HELP
- developersCodingHelp()
-
- currentCategory = CommandCategory.DEVELOPER_DEBUG_FEATURES
- developersDebugFeatures()
-
- currentCategory = CommandCategory.INTERNAL
- internalCommands()
-
- currentCategory = CommandCategory.SHORTENED_COMMANDS
- shortenedCommands()
- }
-
- private fun usersMain() {
- registerCommand("sh", "Opens the main SkyHanni config", openMainMenu)
- registerCommand("skyhanni", "Opens the main SkyHanni config", openMainMenu)
- registerCommand("ff", "Opens the Farming Fortune Guide") { openFortuneGuide() }
- registerCommand("shcommands", "Shows this list") { HelpCommand.onCommand(it, commands) }
- registerCommand0(
- "shdefaultoptions",
- "Select default options",
- { DefaultConfigFeatures.onCommand(it) },
- DefaultConfigFeatures::onComplete,
- )
- registerCommand("shremind", "Set a reminder for yourself") { ReminderManager.command(it) }
- registerCommand("shwords", "Opens the config list for modifying visual words") { openVisualWords() }
- registerCommand("shnavigate", "Using path finder to go to locatons") { NavigationHelper.onCommand(it) }
- }
-
- @Suppress("LongMethod")
- private fun usersNormal() {
- registerCommand(
- "shmarkplayer",
- "Add a highlight effect to a player for better visibility",
- ) { MarkedPlayerManager.command(it) }
- registerCommand("shtrackcollection", "Tracks your collection gain over time") { CollectionTracker.command(it) }
- registerCommand(
- "shcroptime",
- "Calculates with your current crop per second speed how long you need to farm a crop to collect this amount of items",
- ) { GardenCropTimeCommand.onCommand(it) }
- registerCommand(
- "shcropsin",
- "Calculates with your current crop per second how many items you can collect in this amount of time",
- ) { GardenCropsInCommand.onCommand(it) }
- registerCommand(
- "shrpcstart",
- "Manually starts the Discord Rich Presence feature",
- ) { DiscordRPCManager.startCommand() }
- registerCommand(
- "shcropstartlocation",
- "Manually sets the crop start location",
- ) { GardenStartLocation.setLocationCommand() }
- registerCommand(
- "shclearslayerprofits",
- "Clearing the total slayer profit for the current slayer type",
- ) { SlayerProfitTracker.clearProfitCommand(it) }
- registerCommand(
- "shimportghostcounterdata",
- "Manually importing the ghost counter data from GhostCounterV3",
- ) { GhostUtil.importCTGhostCounterData() }
- registerCommand(
- "shclearfarmingitems",
- "Clear farming items saved for the Farming Fortune Guide",
- ) { clearFarmingItems() }
- registerCommand("shresetghostcounter", "Resets the ghost counter") { GhostUtil.reset() }
- registerCommand("shresetpowdertracker", "Resets the Powder Tracker") { PowderTracker.resetCommand() }
- registerCommand("shresetdicertracker", "Resets the Dicer Drop Tracker") { DicerRngDropTracker.resetCommand() }
- registerCommand("shresetcorpsetracker", "Resets the Glacite Mineshaft Corpse Tracker") { CorpseTracker.resetCommand() }
- registerCommand(
- "shresetendernodetracker",
- "Resets the Ender Node Tracker",
- ) { EnderNodeTracker.resetCommand() }
- registerCommand(
- "shresetarmordroptracker",
- "Resets the Armor Drop Tracker",
- ) { ArmorDropTracker.resetCommand() }
- registerCommand(
- "shresetfrozentreasuretracker",
- "Resets the Frozen Treasure Tracker",
- ) { FrozenTreasureTracker.resetCommand() }
- registerCommand(
- "shresetfishingtracker",
- "Resets the Fishing Profit Tracker",
- ) { FishingProfitTracker.resetCommand() }
- registerCommand(
- "shresetvisitordrops",
- "Reset the Visitors Drop Statistics",
- ) { GardenVisitorDropStatistics.resetCommand() }
- registerCommand("shbingotoggle", "Toggle the bingo card display mode") { BingoCardDisplay.toggleCommand() }
- registerCommand(
- "shfarmingprofile",
- "Look up the farming profile from yourself or another player on elitebot.dev",
- ) { FarmingWeightDisplay.lookUpCommand(it) }
- registerCommand(
- "shcopytranslation",
- "Copy the translation of a message in another language to your clipboard.\n" + "Uses a language code that can be found at the end of a translation message.",
- ) { Translator.fromNativeLanguage(it) }
- registerCommand(
- "shtranslate",
- "Translate a message in another language to your language.",
- ) { Translator.toNativeLanguage(it) }
- registerCommand(
- "shmouselock",
- "Lock/Unlock the mouse so it will no longer rotate the player (for farming)",
- ) { LockMouseLook.toggleLock() }
- registerCommand(
- "shsensreduce",
- "Lowers the mouse sensitivity for easier small adjustments (for farming)",
- ) { SensitivityReducer.manualToggle() }
- registerCommand(
- "shresetvermintracker",
- "Resets the Vermin Tracker",
- ) { VerminTracker.resetCommand() }
- registerCommand(
- "shresetdianaprofittracker",
- "Resets the Diana Profit Tracker",
- ) { DianaProfitTracker.resetCommand() }
- registerCommand(
- "shresetpestprofittracker",
- "Resets the Pest Profit Tracker",
- ) { PestProfitTracker.resetCommand() }
- registerCommand(
- "shresetexperimentsprofittracker",
- "Resets the Experiments Profit Tracker",
- ) { ExperimentsProfitTracker.resetCommand() }
- registerCommand(
- "shresetmythologicalcreaturetracker",
- "Resets the Mythological Creature Tracker",
- ) { MythologicalCreatureTracker.resetCommand() }
- registerCommand(
- "shresetseacreaturetracker",
- "Resets the Sea Creature Tracker",
- ) { SeaCreatureTracker.resetCommand() }
- registerCommand(
- "shresetstrayrabbittracker",
- "Resets the Stray Rabbit Tracker",
- ) { ChocolateFactoryStrayTracker.resetCommand() }
- registerCommand(
- "shresetexcavatortracker",
- "Resets the Fossil Excavator Profit Tracker",
- ) { ExcavatorProfitTracker.resetCommand() }
- registerCommand(
- "shfandomwiki",
- "Searches the fandom wiki with SkyHanni's own method.",
- ) { WikiManager.otherWikiCommands(it, true) }
- registerCommand(
- "shfandomwikithis",
- "Searches the fandom wiki with SkyHanni's own method.",
- ) { WikiManager.otherWikiCommands(it, true, true) }
- registerCommand(
- "shofficialwiki",
- "Searches the official wiki with SkyHanni's own method.",
- ) { WikiManager.otherWikiCommands(it, false) }
- registerCommand(
- "shofficialwikithis",
- "Searches the official wiki with SkyHanni's own method.",
- ) { WikiManager.otherWikiCommands(it, false, true) }
- registerCommand0(
- "shcalccrop",
- "Calculate how many crops need to be farmed between different crop milestones.",
- {
- FarmingMilestoneCommand.onCommand(it.getOrNull(0), it.getOrNull(1), it.getOrNull(2), false)
- },
- FarmingMilestoneCommand::onComplete,
- )
- registerCommand0(
- "shcalccroptime",
- "Calculate how long you need to farm crops between different crop milestones.",
- {
- FarmingMilestoneCommand.onCommand(it.getOrNull(0), it.getOrNull(1), it.getOrNull(2), true)
- },
- FarmingMilestoneCommand::onComplete,
- )
- registerCommand0(
- "shcropgoal",
- "Define a custom milestone goal for a crop.",
- { FarmingMilestoneCommand.setGoal(it) },
- FarmingMilestoneCommand::onComplete,
- )
- registerCommand0(
- "shskills",
- "Skills XP/Level related command",
- { SkillAPI.onCommand(it) },
- SkillAPI::onComplete,
- )
- registerCommand(
- "shlimbostats",
- "Prints your Limbo Stats.\n §7This includes your Personal Best, Playtime, and §aSkyHanni User Luck§7!",
- ) { LimboTimeTracker.printStats() }
- registerCommand(
- "shlanedetection",
- "Detect a farming lane in the Garden",
- ) { FarmingLaneCreator.commandLaneDetection() }
- registerCommand(
- "shignore",
- "Add/Remove a user from your",
- ) { PartyChatCommands.blacklist(it) }
- registerCommand(
- "shtpinfested",
- "Teleports you to the nearest infested plot",
- ) { PestFinder.teleportNearestInfestedPlot() }
- registerCommand(
- "shhoppitystats",
- "Look up stats for a Hoppity's Event (by SkyBlock year).\nRun standalone for a list of years that have stats.",
- ) { HoppityEventSummary.sendStatsMessage(it) }
- registerCommand(
- "shcolors",
- "Prints a list of all Minecraft color & formatting codes in chat.",
- ) { ColorFormattingHelper.printColorCodeList() }
- registerCommand(
- "shtps",
- "Informs in chat about the server ticks per second (TPS).",
- ) { TpsCounter.tpsCommand() }
- registerCommand(
- "shcarry",
- "Keep track of carries you do.",
- ) { CarryTracker.onCommand(it) }
- }
+ val commands = mutableListOf<CommandBuilder>()
- private fun usersBugFix() {
- registerCommand("shupdaterepo", "Download the SkyHanni repo again") { SkyHanniMod.repo.updateRepo() }
- registerCommand(
- "shresetburrowwarps",
- "Manually resetting disabled diana burrow warp points",
- ) { BurrowWarpHelper.resetDisabledWarps() }
- registerCommand(
- "shtogglehypixelapierrors",
- "Show/hide hypixel api error messages in chat",
- ) { APIUtils.toggleApiErrorMessages() }
- registerCommand(
- "shclearcropspeed",
- "Reset garden crop speed data and best crop time data",
- ) { GardenAPI.clearCropSpeed() }
- registerCommand(
- "shclearminiondata",
- "Removed bugged minion locations from your private island",
- ) { MinionFeatures.removeBuggedMinions(isCommand = true) }
- registerCommand(
- "shwhereami",
- "Print current island in chat",
- ) { SkyHanniDebugsAndTests.whereAmI() }
- registerCommand(
- "shclearcontestdata",
- "Resets Jacob's Contest Data",
- ) { SkyHanniDebugsAndTests.clearContestData() }
- registerCommand(
- "shconfig",
- "Search or reset config elements §c(warning, dangerous!)",
- ) { SkyHanniConfigSearchResetCommand.command(it) }
- registerCommand(
- "shdebug",
- "Copies SkyHanni debug data in the clipboard.",
- ) { DebugCommand.command(it) }
- registerCommand(
- "shversion",
- "Prints the SkyHanni version in the chat",
- ) { SkyHanniDebugsAndTests.debugVersion() }
- registerCommand(
- "shrendertoggle",
- "Disables/enables the rendering of all skyhanni guis.",
- ) { SkyHanniDebugsAndTests.toggleRender() }
- registerCommand(
- "shcarrolyn",
- "Toggles if the specified crops effect is active from carrolyn",
- ) {
- CaptureFarmingGear.handelCarrolyn(it)
- }
- registerCommand(
- "shrepostatus",
- "Shows the status of all the mods constants",
- ) { SkyHanniMod.repo.displayRepoStatus(false) }
- registerCommand(
- "shclearkismet",
- "Clears the saved values of the applied kismet feathers in Croesus",
- ) { CroesusChestTracker.resetChest() }
- registerCommand(
- "shkingfix",
- "Resets the local King Talisman Helper offset.",
- ) { KingTalismanHelper.kingFix() }
- registerCommand(
- "shupdate",
- "Updates the mod to the specified update stream.",
- ) { forceUpdate(it) }
- registerCommand(
- "shUpdateBazaarPrices",
- "Forcefully updating the bazaar prices right now.",
- ) { HypixelBazaarFetcher.fetchNow() }
- registerCommand(
- "shclearsavedrabbits",
- "Clears the saved rabbits on this profile.",
- ) { HoppityCollectionStats.clearSavedRabbits() }
- registerCommand(
- "shresetpunchcard",
- "Resets the Rift Punchcard Artifact player list.",
- ) { PunchcardHighlight.clearList() }
- registerCommand(
- "shedittracker",
- "Changes the tracked item amount for Diana, Fishing, Pest, Excavator, and Slayer Item Trackers.",
- ) { TrackerManager.commandEditTracker(it) }
+ @HandleEvent
+ fun registerCommands(event: RegisterCommandsEvent) {
+ usersMain(event)
+ usersNormal(event)
+ usersNormalReset(event)
+ usersBugFix(event)
+ devTest(event)
+ devDebug(event)
+ internalCommands(event)
+ shortenedCommands(event)
}
- private fun developersDebugFeatures() {
- registerCommand("shtestbingo", "dev command") { TestBingo.toggle() }
- registerCommand("shprintbingohelper", "dev command") { BingoNextStepHelper.command() }
- registerCommand("shreloadbingodata", "dev command") { BingoCardDisplay.command() }
- registerCommand("shtestgardenvisitors", "dev command") { SkyHanniDebugsAndTests.testGardenVisitors() }
- registerCommand("shtestcomposter", "dev command") { ComposterOverlay.onCommand(it) }
- registerCommand("shtestinquisitor", "dev command") { InquisitorWaypointShare.test() }
- registerCommand("shshowcropmoneycalculation", "dev command") { CropMoneyDisplay.toggleShowCalculation() }
- registerCommand("shcropspeedmeter", "Debugs how many crops you collect over time") { CropSpeedMeter.toggle() }
- registerCommand0(
- "shworldedit",
- "Select regions in the world",
- { WorldEdit.command(it) },
- { listOf("copy", "reset", "help", "left", "right") },
- )
- registerCommand(
- "shconfigsave",
- "Manually saving the config",
- ) { SkyHanniMod.configManager.saveConfig(ConfigFileType.FEATURES, "manual-command") }
- registerCommand(
- "shtestburrow",
- "Sets a test burrow waypoint at your location",
- ) { GriffinBurrowHelper.setTestBurrow(it) }
- registerCommand(
- "shtestsackapi",
- "Get the amount of an item in sacks according to internal feature SackAPI",
- ) { SackAPI.testSackAPI(it) }
- registerCommand(
- "shtestgriffinspots",
- "Show potential griffin spots around you.",
- ) { GriffinBurrowHelper.testGriffinSpots() }
- registerCommand(
- "shtestisland",
- "Sets the current skyblock island for testing purposes.",
- ) { SkyBlockIslandTest.onCommand(it) }
- registerCommand(
- "shdebugprice",
- "Debug different price sources for an item.",
- ) { ItemPriceUtils.debugItemPrice(it) }
- registerCommand(
- "shdebugscoreboard",
- "Monitors the scoreboard changes: Prints the raw scoreboard lines in the console after each update, with time since last update.",
- ) { ScoreboardData.toggleMonitor() }
- registerCommand(
- "shresetterminal",
- "Resets terminal highlights in F7.",
- ) { TerminalInfo.resetTerminals() }
+ private fun usersMain(event: RegisterCommandsEvent) {
+ event.register("sh") {
+ aliases = listOf("skyhanni")
+ description = "Opens the main SkyHanni config"
+ callback { ConfigGuiManager.onCommand(it) }
+ }
+ event.register("ff") {
+ description = "Opens the Farming Fortune Guide"
+ callback { FFGuideGUI.onCommand() }
+ }
+ event.register("shcommands") {
+ description = "Shows this list"
+ callback { HelpCommand.onCommand(it) }
+ }
+ event.register("shdefaultoptions") {
+ description = "Select default options"
+ callback { DefaultConfigFeatures.onCommand(it) }
+ autoComplete { DefaultConfigFeatures.onComplete(it) }
+ }
+ event.register("shremind") {
+ description = "Set a reminder for yourself"
+ callback { ReminderManager.command(it) }
+ }
+ event.register("shwords") {
+ description = "Opens the config list for modifying visual words"
+ callback { VisualWordGui.onCommand() }
+ }
+ event.register("shnavigate") {
+ description = "Using path finder to go to locations"
+ callback { NavigationHelper.onCommand(it) }
+ }
+ event.register("shcarry") {
+ description = "Keep track of carries you do."
+ callback { CarryTracker.onCommand(it) }
+ }
+ event.register("shmarkplayer") {
+ description = "Add a highlight effect to a player for better visibility"
+ callback { MarkedPlayerManager.command(it) }
+ }
+ event.register("shtrackcollection") {
+ description = "Tracks your collection gain over time"
+ callback { CollectionTracker.command(it) }
+ }
}
@Suppress("LongMethod")
- private fun developersCodingHelp() {
- registerCommand("shrepopatterns", "See where regexes are loaded from") { RepoPatternGui.open() }
- registerCommand("shtest", "Unused test command.") { SkyHanniDebugsAndTests.testCommand(it) }
- registerCommand("shtestrabbitpaths", "Tests pathfinding to rabbit eggs. Use a number 0-14.") {
- HoppityEggLocator.testPathfind(it)
- }
- registerCommand(
- "shtestitem",
- "test item internal name resolving",
- ) { SkyHanniDebugsAndTests.testItemCommand(it) }
- registerCommand(
- "shfindnullconfig",
- "Find config elements that are null and prints them into the console",
- ) { SkyHanniDebugsAndTests.findNullConfig(it) }
- registerCommand("shtestwaypoint", "Set a waypoint on that location") { SkyHanniDebugsAndTests.waypoint(it) }
- registerCommand("shtesttablist", "Set your clipboard as a fake tab list.") { TabListData.toggleDebug() }
- registerCommand("shreloadlocalrepo", "Reloading the local repo data") { SkyHanniMod.repo.reloadLocalRepo() }
- registerCommand("shchathistory", "Show the unfiltered chat history") { ChatManager.openChatFilterGUI(it) }
- registerCommand(
- "shstoplisteners",
- "Unregistering all loaded forge event listeners",
- ) { SkyHanniDebugsAndTests.stopListeners() }
- registerCommand(
- "shreloadlisteners",
- "Trying to load all forge event listeners again. Might not work at all",
- ) { SkyHanniDebugsAndTests.reloadListeners() }
- registerCommand(
- "shcopylocation",
- "Copies the player location as LorenzVec format to the clipboard",
- ) { SkyHanniDebugsAndTests.copyLocation(it) }
- registerCommand(
- "shcopyentities",
- "Copies entities in the specified radius around the player to the clipboard",
- ) { CopyNearbyEntitiesCommand.command(it) }
- registerCommand(
- "shtracksounds",
- "Tracks the sounds for the specified duration (in seconds) and copies it to the clipboard",
- ) { TrackSoundsCommand.command(it) }
- registerCommand(
- "shtrackparticles",
- "Tracks the particles for the specified duration (in seconds) and copies it to the clipboard",
- ) { TrackParticlesCommand.command(it) }
- registerCommand(
- "shcopytablist",
- "Copies the tab list data to the clipboard",
- ) { TabListData.copyCommand(it) }
- registerCommand(
- "shcopyactionbar",
- "Copies the action bar to the clipboard, including formatting codes",
- ) { CopyActionBarCommand.command(it) }
- registerCommand(
- "shcopyscoreboard",
- "Copies the scoreboard data to the clipboard",
- ) { CopyScoreboardCommand.command(it) }
- registerCommand(
- "shcopybossbar",
- "Copies the name of the bossbar to the clipboard, including formatting codes",
- ) { CopyBossbarCommand.command(it) }
- registerCommand(
- "shcopyitem",
- "Copies information about the item in hand to the clipboard",
- ) { CopyItemCommand.command() }
- registerCommand("shtestpacket", "Logs incoming and outgoing packets to the console") { PacketTest.command(it) }
- registerCommand(
- "shtestmessage",
- "Sends a custom chat message client side in the chat",
- ) { T