Skip to content

Commit

Permalink
Merge branch 'hannibal002:beta' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoNyaa authored Oct 14, 2024
2 parents 1f5b2bd + 79620d3 commit 613c400
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.RegisterCommandsEvent
import at.hannibal2.skyhanni.config.commands.CommandRegistrationEvent
import at.hannibal2.skyhanni.data.OtherInventoryData
import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson
import at.hannibal2.skyhanni.data.jsonobjects.local.JacobContestsJson
Expand Down Expand Up @@ -59,7 +59,7 @@ class SkyHanniMod {

SkyHanniEvents.init(modules)

RegisterCommandsEvent.post()
CommandRegistrationEvent.post()

PreInitFinishedEvent().post()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.api.event.SkyHanniEvent
import at.hannibal2.skyhanni.config.commands.Commands.commands
import net.minecraftforge.client.ClientCommandHandler

object RegisterCommandsEvent : SkyHanniEvent() {
object CommandRegistrationEvent : SkyHanniEvent() {
fun register(name: String, block: CommandBuilder.() -> Unit) {
val info = CommandBuilder(name).apply(block)
if (commands.any { it.name == name }) {
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ object Commands {
val commands = mutableListOf<CommandBuilder>()

@HandleEvent
fun registerCommands(event: RegisterCommandsEvent) {
fun onCommandRegistration(event: CommandRegistrationEvent) {
usersMain(event)
usersNormal(event)
usersNormalReset(event)
Expand All @@ -121,7 +121,7 @@ object Commands {
shortenedCommands(event)
}

private fun usersMain(event: RegisterCommandsEvent) {
private fun usersMain(event: CommandRegistrationEvent) {
event.register("sh") {
aliases = listOf("skyhanni")
description = "Opens the main SkyHanni config"
Expand Down Expand Up @@ -167,7 +167,7 @@ object Commands {
}

@Suppress("LongMethod")
private fun usersNormal(event: RegisterCommandsEvent) {
private fun usersNormal(event: CommandRegistrationEvent) {
event.register("shimportghostcounterdata") {
description = "Manually importing the ghost counter data from GhostCounterV3"
category = CommandCategory.USERS_ACTIVE
Expand Down Expand Up @@ -308,7 +308,7 @@ object Commands {
}
}

private fun usersNormalReset(event: RegisterCommandsEvent) {
private fun usersNormalReset(event: CommandRegistrationEvent) {

// Trackers
event.register("shresetslayerprofits") {
Expand Down Expand Up @@ -450,7 +450,7 @@ object Commands {
}
}

private fun usersBugFix(event: RegisterCommandsEvent) {
private fun usersBugFix(event: CommandRegistrationEvent) {
event.register("shupdaterepo") {
description = "Download the SkyHanni repo again"
category = CommandCategory.USERS_BUG_FIX
Expand Down Expand Up @@ -508,7 +508,7 @@ object Commands {
}
}

private fun devDebug(event: RegisterCommandsEvent) {
private fun devDebug(event: CommandRegistrationEvent) {
event.register("shdebug") {
description = "Copies SkyHanni debug data in the clipboard."
category = CommandCategory.DEVELOPER_DEBUG
Expand Down Expand Up @@ -640,7 +640,7 @@ object Commands {
}

@Suppress("LongMethod")
private fun devTest(event: RegisterCommandsEvent) {
private fun devTest(event: CommandRegistrationEvent) {
event.register("shtest") {
description = "Unused test command."
category = CommandCategory.DEVELOPER_TEST
Expand Down Expand Up @@ -786,15 +786,15 @@ object Commands {
}
}

private fun internalCommands(event: RegisterCommandsEvent) {
private fun internalCommands(event: CommandRegistrationEvent) {
event.register("shaction") {
description = "Internal command for chat click actions"
category = CommandCategory.INTERNAL
callback { ChatClickActionManager.onCommand(it) }
}
}

private fun shortenedCommands(event: RegisterCommandsEvent) {
private fun shortenedCommands(event: CommandRegistrationEvent) {
event.register("pko") {
description = "Kicks offline party members"
category = CommandCategory.SHORTENED_COMMANDS
Expand Down

0 comments on commit 613c400

Please sign in to comment.