aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at')
-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",
- ) { TestChatCommand.command(it) }
- registerCommand(
- "shtestrainbow",
- "Sends a rainbow in chat",
- ) { ExtendedChatColor.testCommand() }
- registerCommand(
- "shcopyinternalname",
- "Copies the internal name of the item in hand to the clipboard.",
- ) { SkyHanniDebugsAndTests.copyItemInternalName() }
- registerCommand(
- "shpartydebug",
- "List persons into the chat SkyHanni thinks are in your party.",
- ) { PartyAPI.listMembers() }
- registerCommand(
- "shplaysound",
- "Play the specified sound effect at the given pitch and volume.",
- ) { SoundUtils.command(it) }
- registerCommand(
- "shsendtitle",
- "Display a title on the screen with the specified settings.",
- ) { TitleManager.command(it) }
- registerCommand(
- "shresetconfig",
- "Reloads the config manager and rendering processors of MoulConfig. " + "This §cWILL RESET §7your config, but also updating the java config files " + "(names, description, orderings and stuff).",
- ) { SkyHanniDebugsAndTests.resetConfigCommand() }
- registerCommand(
- "shreadcropmilestonefromclipboard",
- "Read crop milestone from clipboard. This helps fixing wrong crop milestone data",
- ) { GardenCropMilestonesCommunityFix.readDataFromClipboard() }
- registerCommand(
- "shcopyfoundburrowlocations",
- "Copy all ever found burrow locations to clipboard",
- ) { AllBurrowsList.copyToClipboard() }
- registerCommand(
- "shaddfoundburrowlocationsfromclipboard",
- "Add all ever found burrow locations from clipboard",
- ) { AllBurrowsList.addFromClipboard() }
- registerCommand(
- "shgraph",
- "Enables the graph editor",
- ) { GraphEditor.commandIn() }
- registerCommand(
- "shtoggleegglocationdebug",
- "Shows Hoppity egg locations with their internal API names and status.",
- ) { HoppityEggLocations.toggleDebug() }
- registerCommand(
- "shresetmineshaftpitystats",
- "Resets the mineshaft pity display stats",
- ) { MineshaftPityDisplay.fullResetCounter() }
- registerCommand(
- "shtranslateadvanced",
- "Translates a message in an inputted language to another inputted language.",
- ) { Translator.translateAdvancedCommand(it) }
- }
-
- private fun internalCommands() {
- registerCommand("shaction", "") { ChatClickActionManager.onCommand(it) }
+ private fun usersNormal(event: RegisterCommandsEvent) {
+ event.register("shimportghostcounterdata") {
+ description = "Manually importing the ghost counter data from GhostCounterV3"
+ category = CommandCategory.USERS_ACTIVE
+ callback { GhostUtil.importCTGhostCounterData() }
+ }
+ event.register("shcroptime") {
+ description = "Calculates with your current crop per second speed " +
+ "how long you need to farm a crop to collect this amount of items"
+ category = CommandCategory.USERS_ACTIVE
+ callback { GardenCropTimeCommand.onCommand(it) }
+ }
+ event.register("shcropsin") {
+ description = "Calculates with your current crop per second how many items you can collect in this amount of time"
+ category = CommandCategory.USERS_ACTIVE
+ callback { GardenCropsInCommand.onCommand(it) }
+ }
+ event.register("shrpcstart") {
+ description = "Manually starts the Discord Rich Presence feature"
+ category = CommandCategory.USERS_ACTIVE
+ callback { DiscordRPCManager.startCommand() }
+ }
+ event.register("shcropstartlocation") {
+ description = "Manually sets the crop start location"
+ category = CommandCategory.USERS_ACTIVE
+ callback { GardenStartLocation.setLocationCommand() }
+ }
+ event.register("shbingotoggle") {
+ description = "Toggle the bingo card display mode"
+ category = CommandCategory.USERS_ACTIVE
+ callback { BingoCardDisplay.toggleCommand() }
+ }
+ event.register("shfarmingprofile") {
+ description = "Look up the farming profile from yourself or another player on elitebot.dev"
+ category = CommandCategory.USERS_ACTIVE
+ callback { FarmingWeightDisplay.lookUpCommand(it) }
+ }
+ event.register("shcopytranslation") {
+ description = "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."
+ category = CommandCategory.USERS_ACTIVE
+ callback { Translator.fromNativeLanguage(it) }
+ }
+ event.register("shtranslate") {
+ description = "Translate a message in another language your language."
+ category = CommandCategory.USERS_ACTIVE
+ callback { Translator.toNativeLanguage(it) }
+ }
+ event.register("shmouselock") {
+ description = "Lock/Unlock the mouse so it will no longer rotate the player (for farming)"
+ category = CommandCategory.USERS_ACTIVE
+ callback { LockMouseLook.toggleLock() }
+ }
+ event.register("shsensreduce") {
+ description = "Lowers the mouse sensitivity for easier small adjustments (for farming)"
+ category = CommandCategory.USERS_ACTIVE
+ callback { SensitivityReducer.manualToggle() }
+ }
+ event.register("shfandomwiki") {
+ description = "Searches the fandom wiki with SkyHanni's own method."
+ category = CommandCategory.USERS_ACTIVE
+ callback { WikiManager.otherWikiCommands(it, true) }
+ }
+ event.register("shfandomwikithis") {
+ description = "Searches the fandom wiki with SkyHanni's own method."
+ category = CommandCategory.USERS_ACTIVE
+ callback { WikiManager.otherWikiCommands(it, true, true) }
+ }
+ event.register("shofficialwiki") {
+ description = "Searches the official wiki with SkyHanni's own method."
+ category = CommandCategory.USERS_ACTIVE
+ callback { WikiManager.otherWikiCommands(it, false) }
+ }
+ event.register("shofficialwikithis") {
+ description = "Searches the official wiki with SkyHanni's own method."
+ category = CommandCategory.USERS_ACTIVE
+ callback { WikiManager.otherWikiCommands(it, false, true) }
+ }
+ event.register("shcalccrop") {
+ description = "Calculate how many crops need to be farmed between different crop milestones."
+ category = CommandCategory.USERS_ACTIVE
+ autoComplete { FarmingMilestoneCommand.onComplete(it) }
+ callback { FarmingMilestoneCommand.onCommand(it.getOrNull(0), it.getOrNull(1), it.getOrNull(2), false) }
+ }
+ event.register("shcalccroptime") {
+ description = "Calculate how long you need to farm crops between different crop milestones."
+ category = CommandCategory.USERS_ACTIVE
+ autoComplete { FarmingMilestoneCommand.onComplete(it) }
+ callback { FarmingMilestoneCommand.onCommand(it.getOrNull(0), it.getOrNull(1), it.getOrNull(2), true) }
+ }
+ event.register("shcropgoal") {
+ description = "Define a custom milestone goal for a crop."
+ category = CommandCategory.USERS_ACTIVE
+ callback { FarmingMilestoneCommand.setGoal(it) }
+ autoComplete { FarmingMilestoneCommand.onComplete(it) }
+ }
+ event.register("shskills") {
+ description = "Skills XP/Level related command"
+ category = CommandCategory.USERS_ACTIVE
+ callback { SkillAPI.onCommand(it) }
+ autoComplete { SkillAPI.onComplete(it) }
+ }
+ event.register("shlimbostats") {
+ description = "Prints your Limbo Stats.\n §7This includes your Personal Best, Playtime, and §aSkyHanni User Luck§7!"
+ category = CommandCategory.USERS_ACTIVE
+ callback { LimboTimeTracker.printStats() }
+ }
+ event.register("shlanedetection") {
+ description = "Detect a farming lane in the Garden"
+ category = CommandCategory.USERS_ACTIVE
+ callback { FarmingLaneCreator.commandLaneDetection() }
+ }
+ event.register("shignore") {
+ description = "Add/Remove a user from your blacklist"
+ category = CommandCategory.USERS_ACTIVE
+ callback { PartyChatCommands.blacklist(it) }
+ }
+ event.register("shtpinfested") {
+ description = "Teleports you to the nearest infested plot"
+ category = CommandCategory.USERS_ACTIVE
+ callback { PestFinder.teleportNearestInfestedPlot() }
+ }
+ event.register("shhoppitystats") {
+ description = "Look up stats for a Hoppity's Event (by SkyBlock year).\nRun standalone for a list of years that have stats."
+ category = CommandCategory.USERS_ACTIVE
+ callback { HoppityEventSummary.sendStatsMessage(it) }
+ }
+ event.register("shcolors") {
+ description = "Prints a list of all Minecraft color & formatting codes in chat."
+ category = CommandCategory.USERS_ACTIVE
+ aliases = listOf("shcolor", "shcolours", "shcolour")
+ callback { ColorFormattingHelper.printColorCodeList() }
+ }
+ event.register("shtps") {
+ description = "Informs in chat about the server ticks per second (TPS)."
+ category = CommandCategory.USERS_ACTIVE
+ callback { TpsCounter.tpsCommand() }
+ }
}
- private fun shortenedCommands() {
- registerCommand("pko", "Kicks offline party members") { PartyCommands.kickOffline() }
- registerCommand("pw", "Warps your party") { PartyCommands.warp() }
- registerCommand("pk", "Kick a specific party member") { PartyCommands.kick(it) }
- registerCommand("pt", "Transfer the party to another party member") { PartyCommands.transfer(it) }
- registerCommand("pp", "Promote a specific party member") { PartyCommands.promote(it) }
- registerCommand("pd", "Disbands the party") { PartyCommands.disband() }
- registerCommand("rpt", "Reverse transfer party to the previous leader") { PartyCommands.reverseTransfer() }
- }
+ private fun usersNormalReset(event: RegisterCommandsEvent) {
- @JvmStatic
- fun openFortuneGuide() {
- if (!LorenzUtils.inSkyBlock) {
- ChatUtils.userError("Join SkyBlock to open the fortune guide!")
- } else {
- FFGuideGUI.open()
+ // Trackers
+ event.register("shresetslayerprofits") {
+ description = "Resets the total slayer profit for the current slayer type"
+ category = CommandCategory.USERS_RESET
+ callback { SlayerProfitTracker.resetCommand() }
+ }
+ event.register("shresetpowdertracker") {
+ description = "Resets the Powder Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { PowderTracker.resetCommand() }
+ }
+ event.register("shresetdicertracker") {
+ description = "Resets the Dicer Drop Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { DicerRngDropTracker.resetCommand() }
+ }
+ event.register("shresetcorpsetracker") {
+ description = "Resets the Glacite Mineshaft Corpse Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { CorpseTracker.resetCommand() }
+ }
+ event.register("shresetendernodetracker") {
+ description = "Resets the Ender Node Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { EnderNodeTracker.resetCommand() }
+ }
+ event.register("shresetarmordroptracker") {
+ description = "Resets the Armor Drop Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { ArmorDropTracker.resetCommand() }
+ }
+ event.register("shresetfrozentreasuretracker") {
+ description = "Resets the Frozen Treasure Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { FrozenTreasureTracker.resetCommand() }
+ }
+ event.register("shresetfishingtracker") {
+ description = "Resets the Fishing Profit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { FishingProfitTracker.resetCommand() }
+ }
+ event.register("shresetvisitordrops") {
+ description = "Resets the Visitors Drop Statistics"
+ category = CommandCategory.USERS_RESET
+ callback { GardenVisitorDropStatistics.resetCommand() }
+ }
+ event.register("shresetvermintracker") {
+ description = "Resets the Vermin Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { VerminTracker.resetCommand() }
+ }
+ event.register("shresetdianaprofittracker") {
+ description = "Resets the Diana Profit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { DianaProfitTracker.resetCommand() }
+ }
+ event.register("shresetpestprofittracker") {
+ description = "Resets the Pest Profit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { PestProfitTracker.resetCommand() }
+ }
+ event.register("shresetexperimentsprofittracker") {
+ description = "Resets the Experiments Profit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { ExperimentsProfitTracker.resetCommand() }
+ }
+ event.register("shresetmythologicalcreaturetracker") {
+ description = "Resets the Mythological Creature Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { MythologicalCreatureTracker.resetCommand() }
+ }
+ event.register("shresetseacreaturetracker") {
+ description = "Resets the Sea Creature Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { SeaCreatureTracker.resetCommand() }
+ }
+ event.register("shresetstrayrabbittracker") {
+ description = "Resets the Stray Rabbit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { ChocolateFactoryStrayTracker.resetCommand() }
+ }
+ event.register("shresetexcavatortracker") {
+ description = "Resets the Fossil Excavator Profit Tracker"
+ category = CommandCategory.USERS_RESET
+ callback { ExcavatorProfitTracker.resetCommand() }
}
- }
- @JvmStatic
- fun openVisualWords() {
- if (!LorenzUtils.onHypixel) {
- ChatUtils.userError("You need to join Hypixel to use this feature!")
- } else {
- if (VisualWordGui.sbeConfigPath.exists()) VisualWordGui.drawImport = true
- SkyHanniMod.screenToOpen = VisualWordGui()
+ // non trackers
+ event.register("shresetghostcounter") {
+ description = "Resets the ghost counter"
+ category = CommandCategory.USERS_RESET
+ callback { GhostUtil.reset() }
+ }
+ event.register("shresetcropspeed") {
+ description = "Resets garden crop speed data and best crop time data"
+ category = CommandCategory.USERS_RESET
+ callback { GardenAPI.resetCropSpeed() }
+ }
+ event.register("shresetkismet") {
+ description = "Resets the saved values of the applied kismet feathers in Croesus"
+ category = CommandCategory.USERS_RESET
+ callback { CroesusChestTracker.resetChest() }
+ }
+ event.register("shresetburrowwarps") {
+ description = "Manually resetting disabled diana burrow warp points"
+ category = CommandCategory.USERS_RESET
+ callback { BurrowWarpHelper.resetDisabledWarps() }
+ }
+ event.register("shresetcontestdata") {
+ description = "Resets Jacob's Contest Data"
+ category = CommandCategory.USERS_RESET
+ callback { SkyHanniDebugsAndTests.resetContestData() }
+ }
+ event.register("shresetfarmingitems") {
+ description = "Resets farming items saved for the Farming Fortune Guide"
+ category = CommandCategory.USERS_RESET
+ callback { CaptureFarmingGear.onResetGearCommand() }
+ }
+ event.register("shresetmineshaftpitystats") {
+ description = "Resets the mineshaft pity display stats"
+ category = CommandCategory.USERS_RESET
+ callback { MineshaftPityDisplay.fullResetCounter() }
+ }
+ event.register("shresetterminal") {
+ description = "Resets terminal highlights in F7."
+ category = CommandCategory.USERS_RESET
+ callback { TerminalInfo.resetTerminals() }
+ }
+ event.register("shresetsavedrabbits") {
+ description = "Resets the saved rabbits on this profile."
+ category = CommandCategory.USERS_RESET
+ callback { HoppityCollectionStats.resetSavedRabbits() }
+ }
+ event.register("shresetpunchcard") {
+ description = "Resets the Rift Punchcard Artifact player list."
+ category = CommandCategory.USERS_RESET
+ callback { PunchcardHighlight.onResetCommand() }
}
}
- private fun clearFarmingItems() {
- val storage = GardenAPI.storage?.fortune ?: return
- ChatUtils.chat("clearing farming items")
- storage.farmingItems.clear()
- storage.outdatedItems.clear()
+ private fun usersBugFix(event: RegisterCommandsEvent) {
+ event.register("shupdaterepo") {
+ description = "Download the SkyHanni repo again"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { SkyHanniMod.repo.updateRepo() }
+ }
+ event.register("shtogglehypixelapierrors") {
+ description = "Show/hide hypixel api error messages in chat"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { APIUtils.toggleApiErrorMessages() }
+ }
+ event.register("shfixminions") {
+ description = "Removed bugged minion locations from your private island"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { MinionFeatures.removeBuggedMinions(isCommand = true) }
+ }
+ event.register("shwhereami") {
+ description = "Print current island in chat"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { SkyHanniDebugsAndTests.whereAmI() }
+ }
+ event.register("shrendertoggle") {
+ description = "Disables/enables the rendering of all skyhanni guis."
+ category = CommandCategory.USERS_BUG_FIX
+ callback { SkyHanniDebugsAndTests.toggleRender() }
+ }
+ event.register("shcarrolyn") {
+ description = "Toggles if the specified crops effect is active from carrolyn"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { CaptureFarmingGear.handelCarrolyn(it) }
+ }
+ event.register("shrepostatus") {
+ description = "Shows the status of all the mods constants"
+ category = CommandCategory.USERS_BUG_FIX
+ callback { SkyHanniMod.repo.displayRepoStatus(false) }
+ }
+ event.register("shkingfix") {
+ description = "Resets the local King Talisman Helper offset."
+ category = CommandCategory.USERS_BUG_FIX
+ callback { KingTalismanHelper.kingFix() }
+ }
+ event.register("shupdate") {
+ description = "Updates the mod to the specified update stream."
+ category = CommandCategory.USERS_BUG_FIX
+ callback { UpdateManager.updateCommand(it) }
+ }
+ event.register("shupdatebazaarprices") {
+ description = "Forcefully updating the bazaar prices right now."
+ category = CommandCategory.USERS_BUG_FIX
+ callback { HypixelBazaarFetcher.fetchNow() }
+ }
+ event.register("shedittracker") {
+ description = "Changes the tracked item amount for Diana, Fishing, Pest, Excavator, and Slayer Item Trackers."
+ category = CommandCategory.USERS_BUG_FIX
+ callback { TrackerManager.commandEditTracker(it) }
+ }
}
- private fun forceUpdate(args: Array<String>) {
- val currentStream = SkyHanniMod.feature.about.updateStream.get()
- val arg = args.firstOrNull() ?: "current"
- val updateStream = when {
- arg.equals("(?i)(?:full|release)s?".toRegex()) -> UpdateStream.RELEASES
- arg.equals("(?i)(?:beta|latest)s?".toRegex()) -> UpdateStream.BETA
- else -> currentStream
+ private fun devDebug(event: RegisterCommandsEvent) {
+ event.register("shdebug") {
+ description = "Copies SkyHanni debug data in the clipboard."
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { DebugCommand.command(it) }
}
-
- val switchingToBeta = updateStream == UpdateStream.BETA && (currentStream != UpdateStream.BETA || !UpdateManager.isCurrentlyBeta())
- if (switchingToBeta) {
- ChatUtils.clickableChat(
- "Are you sure you want to switch to beta? These versions may be less stable.",
- onClick = {
- UpdateManager.checkUpdate(true, updateStream)
- },
- "§eClick to confirm!",
- oneTimeClick = true,
- )
- } else {
- UpdateManager.checkUpdate(true, updateStream)
+ event.register("shconfig") {
+ description = "Searches or resets config elements §c(warning, dangerous!)"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SkyHanniConfigSearchResetCommand.command(it) }
+ }
+ event.register("shversion") {
+ description = "Prints the SkyHanni version in the chat"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SkyHanniDebugsAndTests.debugVersion() }
+ }
+ event.register("shtestbingo") {
+ description = "Toggle the test bingo card display mode"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { TestBingo.toggle() }
+ }
+ event.register("shprintbingohelper") {
+ description = "Prints the next step helper for the bingo card"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { BingoNextStepHelper.command() }
+ }
+ event.register("shreloadbingodata") {
+ description = "Reloads the bingo card data"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { BingoCardDisplay.command() }
+ }
+ event.register("shtestgardenvisitors") {
+ description = "Test the garden visitor drop statistics"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SkyHanniDebugsAndTests.testGardenVisitors() }
+ }
+ event.register("shtestcomposter") {
+ description = "Test the composter overlay"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { ComposterOverlay.onCommand(it) }
+ }
+ event.register("shtestinquisitor") {
+ description = "Test the inquisitor waypoint share"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { InquisitorWaypointShare.test() }
+ }
+ event.register("shshowcropmoneycalculation") {
+ description = "Show the calculation of the crop money"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CropMoneyDisplay.toggleShowCalculation() }
+ }
+ event.register("shcropspeedmeter") {
+ description = "Debugs how many crops you collect over time"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CropSpeedMeter.toggle() }
+ }
+ event.register("shworldedit") {
+ description = "Select regions in the world"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { WorldEdit.command(it) }
+ autoComplete { listOf("copy", "reset", "help", "left", "right") }
+ }
+ event.register("shtestsackapi") {
+ description = "Get the amount of an item in sacks according to internal feature SackAPI"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SackAPI.testSackAPI(it) }
+ }
+ event.register("shtestgriffinspots") {
+ description = "Show potential griffin spots around you."
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { GriffinBurrowHelper.testGriffinSpots() }
+ }
+ event.register("shdebugprice") {
+ description = "Debug different price sources for an item."
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { ItemPriceUtils.debugItemPrice(it) }
+ }
+ event.register("shdebugscoreboard") {
+ description = "Monitors the scoreboard changes: " +
+ "Prints the raw scoreboard lines in the console after each update, with time since last update."
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { ScoreboardData.toggleMonitor() }
+ }
+ event.register("shcopyinternalname") {
+ description = "Copies the internal name of the item in hand to the clipboard."
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SkyHanniDebugsAndTests.copyItemInternalName() }
+ }
+ event.register("shcopylocation") {
+ description = "Copies the player location as LorenzVec format to the clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { SkyHanniDebugsAndTests.copyLocation(it) }
+ }
+ event.register("shcopyentities") {
+ description = "Copies entities in the specified radius around the player to the clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CopyNearbyEntitiesCommand.command(it) }
+ }
+ event.register("shcopytablist") {
+ description = "Copies the tab list data to the clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { TabListData.copyCommand(it) }
+ }
+ event.register("shcopyactionbar") {
+ description = "Copies the action bar to the clipboard, including formatting codes"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CopyActionBarCommand.command(it) }
+ }
+ event.register("shcopyscoreboard") {
+ description = "Copies the scoreboard data to the clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CopyScoreboardCommand.command(it) }
+ }
+ event.register("shcopybossbar") {
+ description = "Copies the name of the bossbar to the clipboard, including formatting codes"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CopyBossbarCommand.command(it) }
+ }
+ event.register("shcopyitem") {
+ description = "Copies information about the item in hand to the clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { CopyItemCommand.command() }
+ }
+ event.register("shcopyfoundburrowlocations") {
+ description = "Copy all ever found burrow locations to clipboard"
+ category = CommandCategory.DEVELOPER_DEBUG
+ callback { AllBurrowsList.copyToClipboard() }
}
}
- private fun registerCommand(rawName: String, description: String, function: (Array<String>) -> Unit) {
- val name = rawName.lowercase()
- if (commands.any { it.name == name }) {
- error("The command '$name is already registered!'")
+ @Suppress("LongMethod")
+ private fun devTest(event: RegisterCommandsEvent) {
+ event.register("shtest") {
+ description = "Unused test command."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.testCommand(it) }
+ }
+ event.register("shchathistory") {
+ description = "Show the unfiltered chat history"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { ChatManager.openChatFilterGUI(it) }
+ }
+ event.register("shreloadlocalrepo") {
+ description = "Reloading the local repo data"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniMod.repo.reloadLocalRepo() }
+ }
+ event.register("shgraph") {
+ description = "Enables the graph editor"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { GraphEditor.commandIn() }
+ }
+ event.register("shrepopatterns") {
+ description = "See where regexes are loaded from"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { RepoPatternGui.open() }
+ }
+ event.register("shtestrabbitpaths") {
+ description = "Tests pathfinding to rabbit eggs. Use a number 0-14."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { HoppityEggLocator.testPathfind(it) }
+ }
+ event.register("shtestitem") {
+ description = "test item internal name resolving"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.testItemCommand(it) }
+ }
+ event.register("shfindnullconfig") {
+ description = "Find config elements that are null and prints them into the console"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.findNullConfig(it) }
+ }
+ event.register("shtestwaypoint") {
+ description = "Set a waypoint on that location"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.waypoint(it) }
+ }
+ event.register("shtesttablist") {
+ description = "Set your clipboard as a fake tab list."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { TabListData.toggleDebug() }
+ }
+ event.register("shstoplisteners") {
+ description = "Unregistering all loaded forge event listeners"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.stopListeners() }
+ }
+ event.register("shreloadlisteners") {
+ description = "Trying to load all forge event listeners again. Might not work at all"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.reloadListeners() }
+ }
+ event.register("shtracksounds") {
+ description = "Tracks the sounds for the specified duration (in seconds) and copies it to the clipboard"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { TrackSoundsCommand.command(it) }
+ }
+ event.register("shtrackparticles") {
+ description = "Tracks the particles for the specified duration (in seconds) and copies it to the clipboard"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { TrackParticlesCommand.command(it) }
+ }
+ event.register("shtestpacket") {
+ description = "Logs incoming and outgoing packets to the console"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { PacketTest.command(it) }
+ }
+ event.register("shtestmessage") {
+ description = "Sends a custom chat message client side in the chat"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { TestChatCommand.command(it) }
+ }
+ event.register("shtestrainbow") {
+ description = "Sends a rainbow in chat"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { ExtendedChatColor.testCommand() }
+ }
+ event.register("shpartydebug") {
+ description = "List persons into the chat SkyHanni thinks are in your party."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { PartyAPI.listMembers() }
+ }
+ event.register("shplaysound") {
+ description = "Play the specified sound effect at the given pitch and volume."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SoundUtils.command(it) }
+ }
+ event.register("shsendtitle") {
+ description = "Display a title on the screen with the specified settings."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { TitleManager.command(it) }
+ }
+ event.register("shresetconfig") {
+ description = "Reloads the config manager and rendering processors of MoulConfig. " +
+ "This §cWILL RESET §7your config, but also updating the java config files " +
+ "(names, description, orderings and stuff)."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniDebugsAndTests.resetConfigCommand() }
+ }
+ event.register("shreadcropmilestonefromclipboard") {
+ description = "Read crop milestone from clipboard. This helps fixing wrong crop milestone data"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { GardenCropMilestonesCommunityFix.readDataFromClipboard() }
+ }
+ event.register("shaddfoundburrowlocationsfromclipboard") {
+ description = "Add all ever found burrow locations from clipboard"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { AllBurrowsList.addFromClipboard() }
+ }
+ event.register("shtoggleegglocationdebug") {
+ description = "Shows Hoppity egg locations with their internal API names and status."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { HoppityEggLocations.toggleDebug() }
+ }
+ event.register("shtranslateadvanced") {
+ description = "Translates a message in an inputted language to another inputted language."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { Translator.translateAdvancedCommand(it) }
+ }
+ event.register("shconfigsave") {
+ description = "Manually saving the config"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyHanniMod.configManager.saveConfig(ConfigFileType.FEATURES, "manual-command") }
+ }
+ event.register("shtestburrow") {
+ description = "Sets a test burrow waypoint at your location"
+ category = CommandCategory.DEVELOPER_TEST
+ callback { GriffinBurrowHelper.setTestBurrow(it) }
+ }
+ event.register("shtestisland") {
+ description = "Sets the current skyblock island for testing purposes."
+ category = CommandCategory.DEVELOPER_TEST
+ callback { SkyBlockIslandTest.onCommand(it) }
}
- ClientCommandHandler.instance.registerCommand(SimpleCommand(name, createCommand(function)))
- commands.add(CommandInfo(name, description, currentCategory))
}
- private fun registerCommand0(
- name: String,
- description: String,
- function: (Array<String>) -> Unit,
- autoComplete: ((Array<String>) -> List<String>) = { listOf() },
- ) {
- val command = SimpleCommand(
- name,
- createCommand(function),
- object : SimpleCommand.TabCompleteRunnable {
- override fun tabComplete(
- sender: ICommandSender?,
- args: Array<String>?,
- pos: BlockPos?,
- ): List<String> {
- return autoComplete(args ?: emptyArray())
- }
- },
- )
- ClientCommandHandler.instance.registerCommand(command)
- commands.add(CommandInfo(name, description, currentCategory))
+ private fun internalCommands(event: RegisterCommandsEvent) {
+ event.register("shaction") {
+ description = "Internal command for chat click actions"
+ category = CommandCategory.INTERNAL
+ callback { ChatClickActionManager.onCommand(it) }
+ }
}
- private fun createCommand(function: (Array<String>) -> Unit) = object : SimpleCommand.ProcessCommandRunnable() {
- override fun processCommand(sender: ICommandSender?, args: Array<String>?) {
- if (args != null) function(args.asList().toTypedArray())
+ private fun shortenedCommands(event: RegisterCommandsEvent) {
+ event.register("pko") {
+ description = "Kicks offline party members"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.kickOffline() }
+ }
+ event.register("pw") {
+ description = "Warps your party"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.warp() }
+ }
+ event.register("pk") {
+ description = "Kick a specific party member"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.kick(it) }
+ }
+ event.register("pt") {
+ description = "Transfer the party to another party member"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.transfer(it) }
+ }
+ event.register("pp") {
+ description = "Promote a specific party member"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.promote(it) }
+ }
+ event.register("pd") {
+ description = "Disbands the party"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.disband() }
+ }
+ event.register("rpt") {
+ description = "Reverse transfer party to the previous leader"
+ category = CommandCategory.SHORTENED_COMMANDS
+ callback { PartyCommands.reverseTransfer() }
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/RegisterCommandsEvent.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/RegisterCommandsEvent.kt
new file mode 100644
index 000000000..448b5d836
--- /dev/null
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/RegisterCommandsEvent.kt
@@ -0,0 +1,16 @@
+package at.hannibal2.skyhanni.config.commands
+
+import at.hannibal2.skyhanni.api.event.SkyHanniEvent
+import at.hannibal2.skyhanni.config.commands.Commands.commands
+import net.minecraftforge.client.ClientCommandHandler
+
+object RegisterCommandsEvent : SkyHanniEvent() {
+ fun register(name: String, block: CommandBuilder.() -> Unit) {
+ val info = CommandBuilder(name).apply(block)
+ if (commands.any { it.name == name }) {
+ error("The command '$name is already registered!'")
+ }
+ ClientCommandHandler.instance.registerCommand(info.toSimpleCommand())
+ commands.add(info)
+ }
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.kt
index b8a5871b7..6240b43bf 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.kt
@@ -5,47 +5,26 @@ import net.minecraft.command.CommandBase
import net.minecraft.command.ICommandSender
import net.minecraft.util.BlockPos
-class SimpleCommand : CommandBase {
-
- private val commandName: String
- private val runnable: ProcessCommandRunnable
- private var tabRunnable: TabCompleteRunnable? = null
-
- constructor(commandName: String, runnable: ProcessCommandRunnable) {
- this.commandName = commandName
- this.runnable = runnable
- }
-
- constructor(commandName: String, runnable: ProcessCommandRunnable, tabRunnable: TabCompleteRunnable?) {
- this.commandName = commandName
- this.runnable = runnable
- this.tabRunnable = tabRunnable
- }
-
- abstract class ProcessCommandRunnable {
-
- abstract fun processCommand(sender: ICommandSender?, args: Array<String>?)
- }
-
- interface TabCompleteRunnable {
-
- fun tabComplete(sender: ICommandSender?, args: Array<String>?, pos: BlockPos?): List<String>
- }
+class SimpleCommand(
+ private val name: String,
+ private val aliases: List<String>,
+ private val callback: (Array<String>) -> Unit,
+ private val tabCallback: ((Array<String>) -> List<String>) = { emptyList() },
+) : CommandBase() {
override fun canCommandSenderUseCommand(sender: ICommandSender) = true
-
- override fun getCommandName() = commandName
-
- override fun getCommandUsage(sender: ICommandSender) = "/$commandName"
+ override fun getCommandName() = name
+ override fun getCommandAliases() = aliases
+ override fun getCommandUsage(sender: ICommandSender) = "/$name"
override fun processCommand(sender: ICommandSender, args: Array<String>) {
try {
- runnable.processCommand(sender, args)
+ callback(args)
} catch (e: Throwable) {
- ErrorManager.logErrorWithData(e, "Error while running command /$commandName")
+ ErrorManager.logErrorWithData(e, "Error while running command /$name")
}
}
override fun addTabCompletionOptions(sender: ICommandSender, args: Array<String>, pos: BlockPos) =
- if (tabRunnable != null) tabRunnable!!.tabComplete(sender, args, pos) else null
+ tabCallback(args).takeIf { it.isNotEmpty() }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java
index 6eb4660d6..a1cb92be0 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java
@@ -1,8 +1,8 @@
package at.hannibal2.skyhanni.config.features.garden;
import at.hannibal2.skyhanni.config.FeatureToggle;
-import at.hannibal2.skyhanni.config.commands.Commands;
import at.hannibal2.skyhanni.config.core.config.Position;
+import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
@@ -21,7 +21,7 @@ public class FarmingFortuneConfig {
@ConfigOption(name = "Farming Fortune Guide", desc = "Open a guide that breaks down your Farming Fortune.\n§eCommand: /ff")
@ConfigEditorButton(buttonText = "Open")
- public Runnable open = Commands::openFortuneGuide;
+ public Runnable open = FFGuideGUI::onCommand;
@Expose
@ConfigLink(owner = FarmingFortuneConfig.class, field = "display")
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/ModifyWordsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/ModifyWordsConfig.java
index 21cfee5c5..5a0db7ac4 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/ModifyWordsConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/ModifyWordsConfig.java
@@ -1,7 +1,7 @@
package at.hannibal2.skyhanni.config.features.gui;
import at.hannibal2.skyhanni.config.FeatureToggle;
-import at.hannibal2.skyhanni.config.commands.Commands;
+import at.hannibal2.skyhanni.features.misc.visualwords.VisualWordGui;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
@@ -17,6 +17,6 @@ public class ModifyWordsConfig {
@ConfigOption(name = "Open Config", desc = "Open the menu to setup the visual words.\n§eCommand: /shwords")
@ConfigEditorButton(buttonText = "Open")
- public Runnable open = Commands::openVisualWords;
+ public Runnable open = VisualWordGui::onCommand;
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
index 2eb5dc3fb..ffffc7511 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
@@ -1,6 +1,8 @@
package at.hannibal2.skyhanni.features.commands
+import at.hannibal2.skyhanni.config.commands.CommandBuilder
import at.hannibal2.skyhanni.config.commands.Commands
+import at.hannibal2.skyhanni.config.commands.Commands.commands
import at.hannibal2.skyhanni.utils.StringUtils.splitLines
import at.hannibal2.skyhanni.utils.chat.Text
import at.hannibal2.skyhanni.utils.chat.Text.hover
@@ -12,7 +14,7 @@ object HelpCommand {
private const val COMMANDS_PER_PAGE = 15
private const val HELP_ID = -6457563
- private fun createCommandEntry(command: Commands.CommandInfo): IChatComponent {
+ private fun createCommandEntry(command: CommandBuilder): IChatComponent {
val category = command.category
val color = category.color
val description = command.description.splitLines(200).replace("§r", "§7")
@@ -30,7 +32,7 @@ object HelpCommand {
}
}
- private fun showPage(page: Int, search: String, commands: List<Commands.CommandInfo>) {
+ private fun showPage(page: Int, search: String, commands: List<CommandBuilder>) {
val filtered = commands.filter {
it.name.contains(search, ignoreCase = true) || it.description.contains(search, ignoreCase = true)
}
@@ -47,7 +49,7 @@ object HelpCommand {
) { createCommandEntry(it) }
}
- fun onCommand(args: Array<String>, commands: List<Commands.CommandInfo>) {
+ fun onCommand(args: Array<String>) {
val page: Int
val search: String
if (args.firstOrNull() == "-p") {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
index 377d7bfd4..5db28465e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt
@@ -269,7 +269,7 @@ object CroesusChestTracker {
fun resetChest() = croesusChests?.let {
it.clear()
it.addAll(generateMaxChest())
- ChatUtils.chat("Kismet State was cleared!")
+ ChatUtils.chat("Kismet State was Reset!")
}
@JvmStatic
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt
index 6d201e57e..ead632ae6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt
@@ -520,9 +520,9 @@ object HoppityCollectionStats {
}
// bugfix for some weird potential user errors (e.g. if users play on alpha and get rabbits)
- fun clearSavedRabbits() {
+ fun resetSavedRabbits() {
loggedRabbits.clear()
- ChatUtils.chat("Cleared saved rabbit data.")
+ ChatUtils.chat("Reset saved rabbit data.")
}
fun hasFoundRabbit(rabbit: String): Boolean = loggedRabbits.containsKey(rabbit)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
index 7e1800931..460b11254 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt
@@ -189,12 +189,18 @@ object GardenAPI {
addItemStack(crop.icon.copy(), highlight = highlight, scale = scale)
}
- fun hideExtraGuis() = ComposterOverlay.inInventory || AnitaMedalProfit.inInventory ||
- SkyMartCopperPrice.inInventory || FarmingContestAPI.inInventory || VisitorAPI.inInventory ||
- FFGuideGUI.isInGui() || ChocolateShopPrice.inInventory || ChocolateFactoryAPI.inChocolateFactory ||
- ChocolateFactoryAPI.chocolateFactoryPaused || HoppityCollectionStats.inInventory
-
- fun clearCropSpeed() {
+ fun hideExtraGuis() = ComposterOverlay.inInventory ||
+ AnitaMedalProfit.inInventory ||
+ SkyMartCopperPrice.inInventory ||
+ FarmingContestAPI.inInventory ||
+ VisitorAPI.inInventory ||
+ FFGuideGUI.isInGui() ||
+ ChocolateShopPrice.inInventory ||
+ ChocolateFactoryAPI.inChocolateFactory ||
+ ChocolateFactoryAPI.chocolateFactoryPaused ||
+ HoppityCollectionStats.inInventory
+
+ fun resetCropSpeed() {
storage?.cropsPerSecond?.clear()
GardenBestCropTime.reset()
updateGardenTool()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
index e8b2d55e4..f3701c61a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt
@@ -387,6 +387,13 @@ object CaptureFarmingGear {
}
}
+ fun onResetGearCommand() {
+ val storage = GardenAPI.storage?.fortune ?: return
+ ChatUtils.chat("Resets farming items")
+ storage.farmingItems.clear()
+ storage.outdatedItems.clear()
+ }
+
@SubscribeEvent
fun onConfigUpdaterMigratorConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(48, "#profile.garden.fortune.carrotFortune", "#profile.garden.fortune.carrolyn.CARROT")
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 3771dd112..8912bd4d1 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
@@ -5,6 +5,8 @@ import at.hannibal2.skyhanni.features.garden.CropType
import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.CropPage
import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.OverviewPage
import at.hannibal2.skyhanni.features.garden.fortuneguide.pages.UpgradePage
+import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.guide.GuideGUI
import at.hannibal2.skyhanni.utils.guide.GuideTab
import at.hannibal2.skyhanni.utils.renderables.Renderable
@@ -20,6 +22,15 @@ class FFGuideGUI : GuideGUI<FFGuideGUI.FortuneGuidePage>(FortuneGuidePage.OVERVI
companion object {
+ @JvmStatic
+ fun onCommand() {
+ if (!LorenzUtils.inSkyBlock) {
+ ChatUtils.userError("Join SkyBlock to open the fortune guide!")
+ } else {
+ open()
+ }
+ }
+
fun isInGui() = Minecraft.getMinecraft().currentScreen is FFGuideGUI
fun open() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
index 9948d5eeb..1f9b2e66f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
@@ -174,4 +174,28 @@ object UpdateManager {
}
private var potentialUpdate: PotentialUpdate? = null
+
+ fun updateCommand(args: Array<String>) {
+ val currentStream = SkyHanniMod.feature.about.updateStream.get()
+ val arg = args.firstOrNull() ?: "current"
+ val updateStream = when {
+ arg.equals("(?i)(?:full|release)s?".toRegex()) -> UpdateStream.RELEASES
+ arg.equals("(?i)(?:beta|latest)s?".toRegex()) -> UpdateStream.BETA
+ else -> currentStream
+ }
+
+ val switchingToBeta = updateStream == UpdateStream.BETA && (currentStream != UpdateStream.BETA || !UpdateManager.isCurrentlyBeta())
+ if (switchingToBeta) {
+ ChatUtils.clickableChat(
+ "Are you sure you want to switch to beta? These versions may be less stable.",
+ onClick = {
+ UpdateManager.checkUpdate(true, updateStream)
+ },
+ "§eClick to confirm!",
+ oneTimeClick = true,
+ )
+ } else {
+ UpdateManager.checkUpdate(true, updateStream)
+ }
+ }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt
index b8de2eca6..fb2f72bed 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/VisualWordGui.kt
@@ -4,10 +4,12 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigFileType
import at.hannibal2.skyhanni.config.ConfigManager
import at.hannibal2.skyhanni.test.command.ErrorManager
+import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ChatUtils.chat
import at.hannibal2.skyhanni.utils.GuiRenderUtils
import at.hannibal2.skyhanni.utils.ItemUtils
import at.hannibal2.skyhanni.utils.KeyboardManager
+import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.SoundUtils
@@ -63,6 +65,16 @@ open class VisualWordGui : GuiScreen() {
companion object {
+ @JvmStatic
+ fun onCommand() {
+ if (!LorenzUtils.onHypixel) {
+ ChatUtils.userError("You need to join Hypixel to use this feature!")
+ } else {
+ if (sbeConfigPath.exists()) drawImport = true
+ SkyHanniMod.screenToOpen = VisualWordGui()
+ }
+ }
+
fun isInGui() = Minecraft.getMinecraft().currentScreen is VisualWordGui
var sbeConfigPath = File("." + File.separator + "config" + File.separator + "SkyblockExtras.cfg")
var drawImport = false
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt
index d1fcea62e..a4068438f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt
@@ -156,7 +156,7 @@ object PunchcardHighlight {
RenderLivingEntityHelper.removeEntityColor(entity)
}
- fun clearList() {
+ fun onResetCommand() {
playerList.clear()
playerQueue.clear()
if (config.reverse.get()) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
index acd37e9d5..defde1cf2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt
@@ -246,7 +246,7 @@ object SlayerProfitTracker {
fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled
- fun clearProfitCommand(args: Array<String>) {
+ fun resetCommand() {
if (itemLogCategory == "") {
ChatUtils.userError(
"No current slayer data found! " +
diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
index fa6537046..ae9b5e45b 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt
@@ -306,9 +306,9 @@ object SkyHanniDebugsAndTests {
private var lastManualContestDataUpdate = SimpleTimeMark.farPast()
- fun clearContestData() {
+ fun resetContestData() {
if (lastManualContestDataUpdate.passedSince() < 30.seconds) {
- ChatUtils.userError("§cYou already cleared Jacob's Contest data recently!")
+ ChatUtils.userError("§cYou already reset Jacob's Contest data recently!")
return
}
lastManualContestDataUpdate = SimpleTimeMark.now()