From 3d4e457a029415ee7483d71ebc993b5f7d1ae258 Mon Sep 17 00:00:00 2001 From: SeRaid <77941535+SeRaid743@users.noreply.github.com> Date: Tue, 14 May 2024 21:46:59 +1200 Subject: [PATCH] make hypixel commands not stupid --- .../hannibal2/skyhanni/api/GetFromSackAPI.kt | 7 +- .../features/garden/PlotIconConfig.java | 4 +- .../skyhanni/data/ProfileStorageData.kt | 3 +- .../features/bingo/card/BingoCardDisplay.kt | 3 +- .../features/commands/PartyChatCommands.kt | 7 +- .../features/commands/PartyCommands.kt | 22 +-- .../features/commands/ViewRecipeCommand.kt | 4 +- .../features/commands/WarpIsCommand.kt | 4 +- .../dungeon/DungeonArchitectFeatures.kt | 3 +- .../features/event/diana/BurrowWarpHelper.kt | 3 +- .../event/diana/InquisitorWaypointShare.kt | 5 +- .../event/hoppity/HoppityEggsShared.kt | 4 +- .../event/winter/NewYearCakeReminder.kt | 3 +- .../features/garden/FarmingFortuneDisplay.kt | 9 +- .../features/garden/GardenLevelDisplay.kt | 3 +- .../features/garden/GardenNextJacobContest.kt | 3 +- .../skyhanni/features/garden/GardenPlotAPI.kt | 6 +- .../features/garden/GardenWarpCommands.kt | 13 +- .../garden/composter/ComposterDisplay.kt | 3 +- .../garden/composter/ComposterOverlay.kt | 9 +- .../features/garden/pests/PestFinder.kt | 3 +- .../features/garden/pests/PestSpawn.kt | 3 +- .../garden/visitor/GardenVisitorSupercraft.kt | 4 +- .../SkyblockGuideHighlightFeature.kt | 6 +- .../features/inventory/bazaar/BazaarApi.kt | 4 +- .../ChocolateFactoryBarnManager.kt | 5 +- .../ChocolateFactoryCustomReminder.kt | 3 +- .../ChocolateFactoryShortcut.kt | 4 +- .../ChocolateFactoryTimeTowerManager.kt | 5 +- .../ChocolateFactoryUpgradeWarning.kt | 3 +- .../inventory/tiarelay/TiaRelayHelper.kt | 3 +- .../skyhanni/features/mining/TunnelsMaps.kt | 4 +- .../features/misc/JoinCrystalHollows.kt | 5 +- .../skyhanni/features/misc/NoBitsWarning.kt | 3 +- .../features/misc/trevor/TrevorFeatures.kt | 6 +- .../skyhanni/features/nether/PabloHelper.kt | 3 +- .../features/skillprogress/SkillProgress.kt | 4 +- .../features/slayer/SlayerRngMeterDisplay.kt | 7 +- .../at/hannibal2/skyhanni/utils/ChatUtils.kt | 9 ++ .../skyhanni/utils/HypixelCommands.kt | 137 ------------------ 40 files changed, 95 insertions(+), 244 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 0cac934cb189..682207378a4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -13,7 +13,6 @@ import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ChatUtils.isCommand import at.hannibal2.skyhanni.utils.ChatUtils.senderIsSkyhanni -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUCalculator import at.hannibal2.skyhanni.utils.NEUInternalName @@ -58,7 +57,7 @@ object GetFromSackAPI { text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.itemName}§e from sacks!", ) = ChatUtils.clickableChat(text, onClick = { - HypixelCommands.getFromSacks(item.internalName.asString(), item.amount) + ChatUtils.sendCommandToServer("gfs ${item.internalName.asString()} ${item.amount}") }) fun getFromSlotClickedSackItems(items: List, slotIndex: Int) = addToInventory(items, slotIndex) @@ -86,7 +85,7 @@ object GetFromSackAPI { if (!LorenzUtils.inSkyBlock) return if (queue.isNotEmpty() && lastTimeOfCommand.passedSince() >= minimumDelay) { val item = queue.poll() - HypixelCommands.getFromSacks(item.internalName.asString().replace('-', ':'), item.amount) + ChatUtils.sendCommandToServer("gfs ${item.internalName.asString().replace('-', ':')} ${item.amount}") lastTimeOfCommand = ChatUtils.getTimeWhenNewlyQueuedMessageGetsExecuted() } } @@ -158,7 +157,7 @@ object GetFromSackAPI { private fun bazaarMessage(item: String, amount: Int, isRemaining: Boolean = false) = ChatUtils.clickableChat( "§lCLICK §r§eto get the ${if (isRemaining) "remaining " else ""}§ax${amount} §9$item §efrom bazaar", - onClick = { HypixelCommands.bazaar(item.removeColor()) } + onClick = { ChatUtils.sendCommandToServer("bazaar ${item.removeColor()}") } ) private fun commandValidator(args: List): Pair { diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/PlotIconConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/PlotIconConfig.java index 1ac01f748c6a..14f7dc87318b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/PlotIconConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/PlotIconConfig.java @@ -2,7 +2,7 @@ import at.hannibal2.skyhanni.config.FeatureToggle; import at.hannibal2.skyhanni.features.garden.inventory.plots.GardenPlotIcon; -import at.hannibal2.skyhanni.utils.HypixelCommands; +import at.hannibal2.skyhanni.utils.ChatUtils; import com.google.gson.annotations.Expose; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton; @@ -19,6 +19,6 @@ public class PlotIconConfig { @ConfigEditorButton(buttonText = "Reset") public Runnable hardReset = () -> { GardenPlotIcon.INSTANCE.setHardReset(true); - HypixelCommands.gardenDesk(); + ChatUtils.sendCommandToServer("desk"); }; } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index 1cab5af1b7e9..466a230dcc5b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -11,7 +11,6 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchFirst @@ -73,7 +72,7 @@ object ProfileStorageData { "§cCan not read profile name from tab list! Open /widget and enable Profile Widget. " + "This is needed for the mod to function! And therefore this warning cannot be disabled", onClick = { - HypixelCommands.widget() + ChatUtils.sendCommandToServer("widget") } ) } else { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt index 5316ffa9251e..7c6a8c24eedf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.features.bingo.card.goals.BingoGoal import at.hannibal2.skyhanni.features.bingo.card.nextstephelper.BingoNextStepHelper import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -84,7 +83,7 @@ object BingoCardDisplay { newList.add(Renderable.clickAndHover("§cOpen the §e/bingo §ccard.", listOf("Click to run §e/bingo"), onClick = { - HypixelCommands.bingo() + ChatUtils.sendCommandToServer("bingo") } )) } else { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt index 357ea3a5675b..b1f9f8c4146a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyChatCommands.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.data.hypixel.chat.event.PartyChatEvent import at.hannibal2.skyhanni.events.TabCompletionEvent import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.mc.McPlayer import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -34,7 +33,7 @@ object PartyChatCommands { { config.transferCommand }, requiresPartyLead = true, executable = { - HypixelCommands.partyTransfer(it.cleanedAuthor) + ChatUtils.sendCommandToServer("party transfer ${it.cleanedAuthor}") } ), PartyChatCommand( @@ -43,7 +42,7 @@ object PartyChatCommands { requiresPartyLead = true, executable = { lastWarp = SimpleTimeMark.now() - HypixelCommands.partyWarp() + ChatUtils.sendCommandToServer("party warp") } ), PartyChatCommand( @@ -52,7 +51,7 @@ object PartyChatCommands { requiresPartyLead = true, executable = { lastAllInvite = SimpleTimeMark.now() - HypixelCommands.partyAllInvite() + ChatUtils.sendCommandToServer("party settings allinvite") } ), ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt index c3438c3534eb..868681e35702 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.events.MessageSendToServerEvent import at.hannibal2.skyhanni.features.misc.limbo.LimboTimeTracker -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.mc.McWorld import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -18,19 +18,19 @@ object PartyCommands { fun kickOffline() { if (!config.shortCommands) return if (PartyAPI.partyMembers.isEmpty()) return - HypixelCommands.partyKickOffline() + ChatUtils.sendCommandToServer("party kickoffline") } fun disband() { if (!config.shortCommands) return if (PartyAPI.partyMembers.isEmpty()) return - HypixelCommands.partyDisband() + ChatUtils.sendCommandToServer("party disband") } fun warp() { if (!config.shortCommands) return if (PartyAPI.partyMembers.isEmpty()) return - HypixelCommands.partyWarp() + ChatUtils.sendCommandToServer("party warp") } fun kick(args: Array) { @@ -40,9 +40,9 @@ object PartyCommands { val kickedPlayer = args[0] val kickedReason = args.drop(1).joinToString(" ").trim() if (kickedReason.isNotEmpty() && config.partyKickReason) { - HypixelCommands.partyChat("Kicking $kickedPlayer: $kickedReason") + ChatUtils.sendCommandToServer("pc Kicking $kickedPlayer: $kickedReason") } - HypixelCommands.partyKick(kickedPlayer) + ChatUtils.sendCommandToServer("party kick $kickedPlayer") } fun transfer(args: Array) { @@ -51,19 +51,19 @@ object PartyCommands { LimboTimeTracker.printStats(true) return } - HypixelCommands.playtime() + ChatUtils.sendCommandToServer("playtime") return } if (!config.shortCommands) return if (PartyAPI.partyMembers.isEmpty()) return - HypixelCommands.partyTransfer(args[0]) + ChatUtils.sendCommandToServer("party transfer ${args[0]}") } fun promote(args: Array) { if (!config.shortCommands) return if (PartyAPI.partyMembers.isEmpty()) return if (args.isEmpty()) return - HypixelCommands.partyPromote(args[0]) + ChatUtils.sendCommandToServer("party promote ${args[0]}") } @SubscribeEvent @@ -82,8 +82,8 @@ object PartyCommands { val kickReason = args.drop(1).joinToString(" ").trim() if (kickReason.isEmpty()) return event.cancel() - HypixelCommands.partyChat("Kicking $kickedPlayer: $kickReason") - HypixelCommands.partyKick(kickedPlayer) + ChatUtils.sendCommandToServer("pc Kicking $kickedPlayer: $kickReason") + ChatUtils.sendCommandToServer("pc $kickedPlayer") } fun customTabComplete(command: String): List? { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt index fbfb1a64086f..a3b1f142f621 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/ViewRecipeCommand.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.commands import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.MessageSendToServerEvent -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.NEUItems import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -20,7 +20,7 @@ object ViewRecipeCommand { val item = message.uppercase().substringAfter("viewrecipe").trim() if (item.isEmpty()) return event.isCanceled = true - HypixelCommands.viewRecipe(item) + ChatUtils.sendCommandToServer("viewrecipe $item") } val list by lazy { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt index c8ae390acd4f..f12f5d9a3e1f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WarpIsCommand.kt @@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.commands import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.MessageSendToServerEvent -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -15,7 +15,7 @@ object WarpIsCommand { if (event.message.lowercase() == "/warp is") { event.isCanceled = true - HypixelCommands.island() + ChatUtils.sendCommandToServer("island") } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt index f19d08d526d9..3078741ce88e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonArchitectFeatures.kt @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacks import at.hannibal2.skyhanni.data.item.SkyhanniItems import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern @@ -45,7 +44,7 @@ object DungeonArchitectFeatures { ChatUtils.clickableChat( "§c§lPUZZLE FAILED! §r§b$name §r§efailed a puzzle. \n" + "§eClick here to get §5Architect's First Draft §7(§e${architectItemAmount}x left§7)", - { HypixelCommands.getFromSacks("ARCHITECT_FIRST_DRAFT", 1) }, + { ChatUtils.sendCommandToServer("gfs ARCHITECT_FIRST_DRAFT 1") }, prefix = false ) LorenzUtils.sendTitle("§c§lPUZZLE FAILED!", 3.seconds) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index b1a660e0003f..dcb70cb1dabc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.sorted -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzVec @@ -34,7 +33,7 @@ object BurrowWarpHelper { currentWarp?.let { if (lastWarpTime.passedSince() > 5.seconds) { lastWarpTime = SimpleTimeMark.now() - HypixelCommands.warp(it.name) + ChatUtils.sendCommandToServer("warp ${it.name}") lastWarp = currentWarp GriffinBurrowHelper.lastTitleSentTime = SimpleTimeMark.now() + 2.seconds TitleManager.optionalResetTitle { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index 4034b810f109..b2fce40151db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzUtils @@ -218,7 +217,7 @@ object InquisitorWaypointShare { return } inquisitor = -1 - HypixelCommands.partyChat("pc Inquisitor dead!") + ChatUtils.sendCommandToServer("pc Inquisitor dead!") } private fun sendInquisitor() { @@ -244,7 +243,7 @@ object InquisitorWaypointShare { val x = location.x.toInt() val y = location.y.toInt() val z = location.z.toInt() - HypixelCommands.partyChat("x: $x, y: $y, z: $z ") + ChatUtils.sendCommandToServer("pc x: $x, y: $y, z: $z") } @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt index 6588fde5f77e..097cc9bd9883 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsShared.kt @@ -3,7 +3,7 @@ package at.hannibal2.skyhanni.features.event.hoppity import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager.getEggType import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.groupOrNull import at.hannibal2.skyhanni.utils.LorenzVec @@ -54,7 +54,7 @@ object HoppityEggsShared { val y = closestEgg.y.toInt() val z = closestEgg.z.toInt() - HypixelCommands.allChat("[SkyHanni] ${meal.mealName} Chocolate Egg located at x: $x, y: $y, z: $z ($note)") + ChatUtils.sendCommandToServer("ac [SkyHanni] ${meal.mealName} Chocolate Egg located at x: $x, y: $y, z: $z ($note)") } fun isEnabled() = LorenzUtils.inSkyBlock && config.waypoints && config.sharedWaypoints diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt index 9c71ffb2ca92..45f268f9deff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/winter/NewYearCakeReminder.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.fame.ReminderUtils import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matches @@ -65,7 +64,7 @@ object NewYearCakeReminder { ChatUtils.clickableChat( "Reminding you to grab the free New Year Cake. Click here to open the baker menu!", onClick = { - HypixelCommands.openBaker() + ChatUtils.sendCommandToServer("openbaker") } ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index e2be01f8495f..893a473024f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -12,7 +12,6 @@ import at.hannibal2.skyhanni.features.garden.CropType.Companion.getTurboCrop import at.hannibal2.skyhanni.features.garden.pests.PestAPI import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.NEUInternalName @@ -190,7 +189,7 @@ object FarmingFortuneDisplay { "§cshowing latest Crop Fortune." ), onClick = { - HypixelCommands.widget() + ChatUtils.sendCommandToServer("widget") } )) } else { @@ -201,7 +200,7 @@ object FarmingFortuneDisplay { "§cshowing the Farming Fortune stat." ), onClick = { - HypixelCommands.widget() + ChatUtils.sendCommandToServer("widget") } )) } @@ -217,7 +216,7 @@ object FarmingFortuneDisplay { "§cCan not read Farming Fortune from tab list! Open /widget and enable the Stats Widget " + "and showing the Farming Fortune stat.", onClick = { - HypixelCommands.widget() + ChatUtils.sendCommandToServer("widget") } ) lastUniversalFortuneMissingError = SimpleTimeMark.now() @@ -228,7 +227,7 @@ object FarmingFortuneDisplay { "§cCan not read Crop Fortune from tab list! Open /widget and enable the Stats Widget " + "and showing latest Crop Fortune.", onClick = { - HypixelCommands.widget() + ChatUtils.sendCommandToServer("widget") } ) lastCropFortuneMissingError = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index 5692afffa062..5d3b91f3cbf9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConditionalUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -96,7 +95,7 @@ object GardenLevelDisplay { " \n§b§lGARDEN LEVEL UP §8$oldLevel ➜ §b$newLevel\n" + " §8+§aRespect from Elite Farmers and SkyHanni members :)\n ", onClick = { - HypixelCommands.gardenLevels() + ChatUtils.sendCommandToServer("gardenlevels") }, prefix = false ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index ab8617762fed..c484a546bcae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -17,7 +17,6 @@ import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.APIUtil import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConfigUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils @@ -561,7 +560,7 @@ object GardenNextJacobContest { } else { ChatUtils.chat("This year's contests aren't available to fetch automatically yet, please load them from your calendar or wait 10 minutes.") ChatUtils.clickableChat("Click here to open your calendar!", onClick = { - HypixelCommands.calendar() + ChatUtils.sendCommandToServer("calendar") }) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt index db340c2ad827..9f13d138bd78 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.garden.pests.SprayType import at.hannibal2.skyhanni.features.misc.LockMouseLook -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzVec @@ -207,8 +207,8 @@ object GardenPlotAPI { fun Plot.isPlayerInside() = box.contains(McPlayer.pos) fun Plot.sendTeleportTo() { - if (isBarn()) HypixelCommands.teleportToPlot("barn") - else HypixelCommands.teleportToPlot(name) + if (isBarn()) ChatUtils.sendCommandToServer("tptoplot barn") + else ChatUtils.sendCommandToServer("tptoplot $name") LockMouseLook.autoDisable() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt index c177deccb2e6..e465ad91f75e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.MessageSendToServerEvent import at.hannibal2.skyhanni.features.misc.LockMouseLook import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -33,20 +32,20 @@ object GardenWarpCommands { if (message == "/home") { event.isCanceled = true - HypixelCommands.warp("garden") + ChatUtils.sendCommandToServer("warp garden") ChatUtils.chat("§aTeleported you to the spawn location!", prefix = false) } if (message == "/barn") { event.isCanceled = true - HypixelCommands.teleportToPlot("barn") + ChatUtils.sendCommandToServer("tptoplot barn") LockMouseLook.autoDisable() } tpPlotPattern.matchMatcher(event.message) { event.isCanceled = true val plotName = group("plot") - HypixelCommands.teleportToPlot(plotName) + ChatUtils.sendCommandToServer("tptoplot $plotName") LockMouseLook.autoDisable() } } @@ -61,16 +60,16 @@ object GardenWarpCommands { when (event.keyCode) { config.homeHotkey -> { - HypixelCommands.warp("garden") + ChatUtils.sendCommandToServer("warp garden") } config.sethomeHotkey -> { - HypixelCommands.setHome() + ChatUtils.sendCommandToServer("sethome") } config.barnHotkey -> { LockMouseLook.autoDisable() - HypixelCommands.teleportToPlot("barn") + ChatUtils.sendCommandToServer("tptoplot barn") } else -> return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt index fbaadbc4cdd3..5d8188f941a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt @@ -9,7 +9,6 @@ import at.hannibal2.skyhanni.features.fame.ReminderUtils import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.NEUInternalName @@ -178,7 +177,7 @@ object ComposterDisplay { ChatUtils.chat(warningMessage) } else { ChatUtils.clickableChat(warningMessage, onClick = { - HypixelCommands.warp("garden") + ChatUtils.sendCommandToServer("warp garden") }) } LorenzUtils.sendTitle("§eComposter Warning!", 3.seconds) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index e9976fde8dca..ccac3c8e5928 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -25,7 +25,6 @@ import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.CollectionUtils.sortedDesc import at.hannibal2.skyhanni.utils.ConfigUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils @@ -491,7 +490,7 @@ object ComposterOverlay { } val havingInSacks = internalName.getAmountInSacksOrNull() ?: run { - HypixelCommands.getFromSacks(internalName.asString(), itemsNeeded - havingInInventory) + ChatUtils.sendCommandToServer("gfs ${internalName.asString()} ${itemsNeeded - havingInInventory}") // TODO Add sack type repo data val isDwarvenMineable = @@ -500,7 +499,7 @@ object ComposterOverlay { ChatUtils.clickableChat( "Sacks could not be loaded. Click here and open your §9$sackType Sack §eto update the data!", onClick = { - HypixelCommands.sacks() + ChatUtils.sendCommandToServer("sax") } ) return @@ -516,7 +515,7 @@ object ComposterOverlay { return } - HypixelCommands.getFromSacks(internalName.asString(), itemsNeeded - havingInInventory) + ChatUtils.sendCommandToServer("gfs ${internalName.asString()} ${itemsNeeded - havingInInventory}") val havingInTotal = havingInInventory + havingInSacks if (itemsNeeded >= havingInTotal) { if (LorenzUtils.noTradeMode) { @@ -525,7 +524,7 @@ object ComposterOverlay { ChatUtils.clickableChat( // TODO Add this as a separate feature, and then don't send any msg if the feature is disabled "You're out of $itemName §ein your sacks! Click here to buy more on the Bazaar!", onClick = { - HypixelCommands.bazaar(itemName.removeColor()) + ChatUtils.sendCommandToServer("bz ${itemName.removeColor()}") } ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt index 22e96a38a4e1..d4a1185e4bf1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt @@ -17,7 +17,6 @@ import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.renderPlot import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.sendTeleportTo import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.NEUItems @@ -84,7 +83,7 @@ object PestFinder { "Runs /desk." ), onClick = { - HypixelCommands.gardenDesk() + ChatUtils.sendCommandToServer("desk") } )) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt index a86ceba4620c..212aec741e7d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.events.garden.pests.PestSpawnEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ConfigUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -130,7 +129,7 @@ object PestSpawn { if (config.chatMessageFormat == PestSpawnConfig.ChatMessageFormatEntry.COMPACT) { ChatUtils.clickableChat(message, onClick = { - HypixelCommands.teleportToPlot(plotName) + ChatUtils.sendCommandToServer("tptoplot $plotName") }) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt index 36e6427b7571..826392b2788e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt @@ -6,7 +6,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorOpenEvent import at.hannibal2.skyhanni.test.command.ErrorManager -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName @@ -108,7 +108,7 @@ object GardenVisitorSupercraft { if (event.slotId != 31) return event.isCanceled = true if (lastClick.passedSince() > 0.3.seconds) { - HypixelCommands.recipe(lastSuperCraftMaterial) + ChatUtils.sendCommandToServer("recipe $lastSuperCraftMaterial") lastClick = SimpleTimeMark.now() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt index 59f94425f1b0..b6a1bbc7fd96 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SkyblockGuideHighlightFeature.kt @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -142,7 +142,7 @@ class SkyblockGuideHighlightFeature private constructor( private val openWikiOnClick: (GuiContainerEvent.SlotClickEvent) -> Unit = { event -> val internalName = event.item?.getInternalName() if (internalName != null) { - HypixelCommands.wiki(internalName.asString()) + ChatUtils.sendCommandToServer("wiki ${internalName.asString()}") } } @@ -172,7 +172,7 @@ class SkyblockGuideHighlightFeature private constructor( "travel", "Core ➜ Fast Travels Unlocked", taskOnlyCompleteOncePattern, - { HypixelCommands.wiki("MUSEUM_TRAVEL_SCROLL") }, // The items do not have proper internal names and using the fact that all travel scrolls lead to the same wiki page + { ChatUtils.sendCommandToServer("wiki MUSEUM_TRAVEL_SCROLL") }, // The items do not have proper internal names and using the fact that all travel scrolls lead to the same wiki page openWikiTooltip ) SkyblockGuideHighlightFeature( diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt index 781f057cc416..6d30e6ad930b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt @@ -10,7 +10,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI import at.hannibal2.skyhanni.test.command.ErrorManager -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.InventoryUtils.getAllItems import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -54,7 +54,7 @@ object BazaarApi { if (NEUItems.neuHasFocus()) return if (LorenzUtils.noTradeMode) return if (DungeonAPI.inDungeon() || LorenzUtils.inKuudraFight) return - HypixelCommands.bazaar(displayName.removeColor()) + ChatUtils.sendCommandToServer("bz ${displayName.removeColor()}") if (amount != -1) OS.copyToClipboard(amount.toString()) currentSearchedItem = displayName.removeColor() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt index b753a5697849..f989265f5c2e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryBarnManager.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggsManager import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.formatLong import at.hannibal2.skyhanni.utils.SimpleTimeMark @@ -88,7 +87,7 @@ object ChocolateFactoryBarnManager { ChatUtils.clickableChat( "Open your chocolate factory to see your barn's capacity status!", onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) return @@ -103,7 +102,7 @@ object ChocolateFactoryBarnManager { "§cYour barn is almost full! §7(${barnStatus()}). §cUpgrade it so they don't get crushed" }, onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) McSound.BEEP.play() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt index 0d95763cf433..f78aa5c7bbcb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryCustomReminder.kt @@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.fame.ReminderUtils import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils @@ -137,7 +136,7 @@ object ChocolateFactoryCustomReminder { } ChatUtils.clickableChat( "You can now purchase §f$targetName §ein Chocolate factory!", onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt index 29f41ca04553..c5cecc6aea04 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent -import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark @@ -63,7 +63,7 @@ object ChocolateFactoryShortcut { if (!showItem || event.slotId != 15) return event.cancel() if (lastClick.passedSince() > 2.seconds) { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") lastClick = SimpleTimeMark.now() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt index 4c2240bf159e..44a597fc362e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.fame.ReminderUtils import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.mc.McSound @@ -47,7 +46,7 @@ object ChocolateFactoryTimeTowerManager { "Your Time Tower has another charge available §7(${timeTowerCharges()})§e, " + "Click here to use one", onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) McSound.BEEP.play() @@ -70,7 +69,7 @@ object ChocolateFactoryTimeTowerManager { "§cYour Time Tower is full §7(${timeTowerCharges()})§c, " + "Use one to avoid wasting time tower usages!", onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) McSound.BEEP.play() diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgradeWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgradeWarning.kt index c4e0015dc4a8..d6a591606cb0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgradeWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgradeWarning.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.fame.ReminderUtils import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.datetime.TimeUtils.minutes @@ -46,7 +45,7 @@ object ChocolateFactoryUpgradeWarning { ChatUtils.clickableChat( "You have a Chocolate factory upgrade available to purchase!", onClick = { - HypixelCommands.chocolateFactory() + ChatUtils.sendCommandToServer("cf") } ) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt index c55c016819c6..9f299624bea5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.sorted -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils @@ -75,7 +74,7 @@ object TiaRelayHelper { if (sound.value.name != name) { ChatUtils.userError("Tia Relay Helper error: Too much background noise! Try turning off the music and then try again.") ChatUtils.clickableChat("Click here to run /togglemusic", onClick = { - HypixelCommands.toggleMusic() + ChatUtils.sendCommandToServer("togglemusic") }) sounds.clear() return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt index 1f977bef9c6d..847423d5903a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt @@ -17,12 +17,12 @@ import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.LorenzWarpEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.test.command.ErrorManager +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.filterNotNullKeys import at.hannibal2.skyhanni.utils.ColorUtils.getFirstColorCode import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle import at.hannibal2.skyhanni.utils.DelayedRun -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.LocationUtils @@ -421,7 +421,7 @@ object TunnelsMaps { private fun campfireKey(event: LorenzKeyPressEvent) { if (event.keyCode != config.campfireKey) return if (config.travelScroll) { - HypixelCommands.warp("basecamp") + ChatUtils.sendCommandToServer("warp basecamp") } else { campfireOverride() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt index 4f32d4cfae61..506e2e89ba62 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.LorenzVec @@ -28,7 +27,7 @@ object JoinCrystalHollows { if (!IslandType.DWARVEN_MINES.isInIsland()) { ChatUtils.clickableChat("Click here to warp to Dwarven Mines!", onClick = { - HypixelCommands.warp("mines") + ChatUtils.sendCommandToServer("warp mines") }) } else { ChatUtils.chat("Buy a §2Crystal Hollows Pass §efrom §5Gwendolyn") @@ -36,7 +35,7 @@ object JoinCrystalHollows { } if (message == "§e[NPC] §5Gwendolyn§f: §rGreat! Now hop on into the Minecart and I'll get you on your way!" && inTime()) { ChatUtils.clickableChat("Click here to warp to Crystal Hollows!", onClick = { - HypixelCommands.warp("ch") + ChatUtils.sendCommandToServer("warp ch") }) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt index 97f85559af39..86af0f9c5e40 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.BitsUpdateEvent import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.mc.McSound @@ -22,7 +21,7 @@ object NoBitsWarning { ChatUtils.clickableChat( "§bNo Bits Available! §eClick to run /bz booster cookie.", onClick = { - HypixelCommands.bazaar("booster cookie") + ChatUtils.sendCommandToServer("bz booster cookie") } ) LorenzUtils.sendTitle("§bNo Bits Available", 5.seconds) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index a6ddf174c14e..8b0d6fa1c31b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -15,9 +15,9 @@ import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha import at.hannibal2.skyhanni.utils.ConfigUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer import at.hannibal2.skyhanni.utils.LorenzColor @@ -288,7 +288,7 @@ object TrevorFeatures { val timeSince = lastChatPromptTime.passedSince() if (timeSince > 200.milliseconds && timeSince < 5.seconds) { lastChatPromptTime = SimpleTimeMark.farPast() - HypixelCommands.chatPrompt(lastChatPrompt) + ChatUtils.sendCommandToServer("chatprompt $lastChatPrompt") lastChatPrompt = "" timeLastWarped = SimpleTimeMark.now() return @@ -296,7 +296,7 @@ object TrevorFeatures { } if (config.warpToTrapper && timeLastWarped.passedSince() > 3.seconds && teleportBlock.passedSince() > 5.seconds) { - HypixelCommands.warp("trapper") + ChatUtils.sendCommandToServer("warp trapper") timeLastWarped = SimpleTimeMark.now() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt index 1db26f082d69..87c2a62e1436 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt @@ -4,7 +4,6 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.SimpleTimeMark @@ -36,7 +35,7 @@ object PabloHelper { if (McPlayer.countItems { it.name.contains(itemName) } > 0) return ChatUtils.clickableChat("Click here to grab an $itemName from sacks!", onClick = { - HypixelCommands.getFromSacks(itemName, 1) + ChatUtils.sendCommandToServer("gfs $itemName 1") }) lastSentMessage = SimpleTimeMark.now() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt index 3444da3d2e66..6e6643e86efd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -15,10 +15,10 @@ import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.SkillOverflowLevelupEvent import at.hannibal2.skyhanni.features.skillprogress.SkillUtil.XP_NEEDED_FOR_60 +import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ChatUtils.chat import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColorInt import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatDouble @@ -284,7 +284,7 @@ object SkillProgress { Renderable.clickAndHover( "§cOpen your skills menu!", listOf("§eClick here to execute §6/skills"), - onClick = { HypixelCommands.skills() } + onClick = { ChatUtils.sendCommandToServer("skills") } ) } else { val tips = buildList { diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt index 9f70cfa5f8b3..3c036317bac2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt @@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.events.SlayerChangeEvent import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.nextAfter -import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.itemName @@ -204,7 +203,11 @@ object SlayerRngMeterDisplay { private fun makeLink(text: String) = Renderable.clickAndHover(text, listOf("§eClick to open RNG Meter Inventory."), onClick = { - HypixelCommands.showRng("slayer", SlayerAPI.getActiveSlayer()?.rngName) + if (SlayerAPI.getActiveSlayer()?.rngName == null) { + ChatUtils.sendCommandToServer("rng") + } else { + ChatUtils.sendCommandToServer("rng slayer ${SlayerAPI.getActiveSlayer()?.rngName}") + } }) fun drawDisplay(): String { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt index 36c66abda461..8d7fdb74d30c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt @@ -220,6 +220,15 @@ object ChatUtils { sendQueue.add(message) } + //JvmStatic needed since this is also used in moulconfig runnable + @JvmStatic + fun sendCommandToServer(command: String) { + if (command.startsWith("/")) { + debug("Sending wrong command to server? ($command)") + } + sendQueue.add("/$command") + } + fun MessageSendToServerEvent.isCommand(commandWithSlash: String) = splitMessage.takeIf { it.isNotEmpty() }?.get(0) == commandWithSlash diff --git a/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt b/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt deleted file mode 100644 index 9675ff5179a4..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/utils/HypixelCommands.kt +++ /dev/null @@ -1,137 +0,0 @@ -package at.hannibal2.skyhanni.utils - -object HypixelCommands { - - fun bazaar(searchTerm: String) { - send("bz $searchTerm") - } - - fun playtime() { - send("playtime") - } - - fun skills() { - send("skills") - } - - fun viewRecipe(itemName: String) { - send("viewrecipe $itemName") - } - - fun recipe(itemName: String) { - send("recipe $itemName") - } - - fun warp(warp: String) { - send("warp $warp") - } - - fun island() { - send("is") - } - - @JvmStatic - fun gardenDesk() { - send("desk") - } - - fun teleportToPlot(plotName: String) { - send("tptoplot $plotName") - } - - fun gardenLevels() { - send("gardenlevels") - } - - fun setHome() { - send("sethome") - } - - fun getFromSacks(itemName: String, amount: Int) { - send("gfs $itemName $amount") - } - - fun widget() { - send("widget") - } - - fun chocolateFactory() { - send("cf") - } - - fun openBaker() { - send("openbaker") - } - - fun calendar() { - send("calendar") - } - - fun sacks() { - send("sax") - } - - fun toggleMusic() { - send("togglemusic") - } - - fun bingo() { - send("bingo") - } - - fun wiki(text: String) { - send("wiki $text") - } - - fun partyWarp() { - send("party warp") - } - - fun partyTransfer(player: String) { - send("party transfer $player") - } - - fun partyDisband() { - send("party disband") - } - - fun partyKick(player: String) { - send("party kick $player") - } - - fun partyKickOffline() { - send("party kickoffline") - } - - fun partyAllInvite() { - send("party settings allinvite") - } - - fun partyPromote(player: String) { - send("party promote $player") - } - - fun partyChat(message: String) { - send("pc $message") - } - - fun allChat(message: String) { - send("ac $message") - } - - fun showRng(major: String? = null, minor: String? = null) = when { - major == null || minor == null -> send("rng") - else -> send("rng $major $minor") - } - - fun chatPrompt(prompt: String) { - send("chatprompt $prompt") - } - - private fun send(command: String) { - if (command.startsWith("/")) { - ChatUtils.debug("Sending wrong command to server? ($command)") - } - ChatUtils.sendMessageToServer("/$command") - } -}