Skip to content

Commit

Permalink
chore: migrate cata command to types
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Dec 22, 2023
1 parent a2e5492 commit ef9a549
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hypixel-api
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import gg.essential.universal.utils.MCHoverEventAction
import gg.essential.universal.wrappers.message.UMessage
import gg.essential.universal.wrappers.message.UTextComponent
import gg.skytils.hypixel.types.skyblock.Member
import gg.skytils.skytilsmod.Skytils
import gg.skytils.skytilsmod.Skytils.Companion.failPrefix
import gg.skytils.skytilsmod.commands.stats.StatCommand
import gg.skytils.skytilsmod.core.API
import gg.skytils.skytilsmod.utils.NumberUtil.nf
import gg.skytils.skytilsmod.utils.SkillUtils
import gg.skytils.skytilsmod.utils.append
Expand All @@ -41,7 +41,7 @@ object CataCommand : StatCommand("skytilscata") {

override fun displayStats(username: String, uuid: UUID, profileData: Member) {
val playerResponse = try {
Skytils.hylinAPI.getPlayerSync(uuid)
API.getPlayerSync(uuid)
} catch (e: HypixelAPIException) {
printMessage(
"$failPrefix §cFailed to get dungeon stats: ${
Expand Down
5 changes: 5 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsmod/core/API.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@ object API {
parameter("uuid", uuid.toString())
}
}.body<PlayerResponse>().player

fun getPlayerSync(uuid: UUID) =
runBlocking {
getPlayer(uuid)
}
}

0 comments on commit ef9a549

Please sign in to comment.