Skip to content

Commit

Permalink
make hypixel commands not stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
catgirlseraid committed May 14, 2024
1 parent 15d9442 commit 3d4e457
Show file tree
Hide file tree
Showing 40 changed files with 95 additions and 244 deletions.
7 changes: 3 additions & 4 deletions src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<PrimitiveItemStack>, slotIndex: Int) = addToInventory(items, slotIndex)
Expand Down Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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<String>): Pair<CommandResult, PrimitiveItemStack?> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,6 +19,6 @@ public class PlotIconConfig {
@ConfigEditorButton(buttonText = "Reset")
public Runnable hardReset = () -> {
GardenPlotIcon.INSTANCE.setHardReset(true);
HypixelCommands.gardenDesk();
ChatUtils.sendCommandToServer("desk");
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,7 +33,7 @@ object PartyChatCommands {
{ config.transferCommand },
requiresPartyLead = true,
executable = {
HypixelCommands.partyTransfer(it.cleanedAuthor)
ChatUtils.sendCommandToServer("party transfer ${it.cleanedAuthor}")
}
),
PartyChatCommand(
Expand All @@ -43,7 +42,7 @@ object PartyChatCommands {
requiresPartyLead = true,
executable = {
lastWarp = SimpleTimeMark.now()
HypixelCommands.partyWarp()
ChatUtils.sendCommandToServer("party warp")
}
),
PartyChatCommand(
Expand All @@ -52,7 +51,7 @@ object PartyChatCommands {
requiresPartyLead = true,
executable = {
lastAllInvite = SimpleTimeMark.now()
HypixelCommands.partyAllInvite()
ChatUtils.sendCommandToServer("party settings allinvite")
}
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<String>) {
Expand All @@ -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<String>) {
Expand All @@ -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<String>) {
if (!config.shortCommands) return
if (PartyAPI.partyMembers.isEmpty()) return
if (args.isEmpty()) return
HypixelCommands.partyPromote(args[0])
ChatUtils.sendCommandToServer("party promote ${args[0]}")
}

@SubscribeEvent
Expand All @@ -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<String>? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -15,7 +15,7 @@ object WarpIsCommand {

if (event.message.lowercase() == "/warp is") {
event.isCanceled = true
HypixelCommands.island()
ChatUtils.sendCommandToServer("island")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -218,7 +217,7 @@ object InquisitorWaypointShare {
return
}
inquisitor = -1
HypixelCommands.partyChat("pc Inquisitor dead!")
ChatUtils.sendCommandToServer("pc Inquisitor dead!")
}

private fun sendInquisitor() {
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -190,7 +189,7 @@ object FarmingFortuneDisplay {
"§cshowing latest Crop Fortune."
),
onClick = {
HypixelCommands.widget()
ChatUtils.sendCommandToServer("widget")
}
))
} else {
Expand All @@ -201,7 +200,7 @@ object FarmingFortuneDisplay {
"§cshowing the Farming Fortune stat."
),
onClick = {
HypixelCommands.widget()
ChatUtils.sendCommandToServer("widget")
}
))
}
Expand All @@ -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()
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand Down
Loading

0 comments on commit 3d4e457

Please sign in to comment.