11package org.polyfrost.polyplus.client
22
3+ import dev.deftu.omnicore.api.client.commands.OmniClientCommands
34import dev.deftu.omnicore.api.client.player.playerUuid
5+ import dev.deftu.textile.Text
6+ import dev.deftu.textile.minecraft.MCTextStyle
7+ import dev.deftu.textile.minecraft.TextColors
48import io.ktor.client.HttpClient
59import io.ktor.client.engine.cio.CIO
610import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
@@ -24,6 +28,8 @@ import org.polyfrost.polyplus.client.network.http.PolyAuthorization
2428import org.polyfrost.polyplus.client.network.http.PolyCosmetics
2529import org.polyfrost.polyplus.client.network.websocket.PolyConnection
2630import org.polyfrost.polyplus.client.network.websocket.ServerboundPacket
31+ import org.polyfrost.polyui.data.PolyImage
32+ import org.polyfrost.polyui.utils.image
2733
2834object PolyPlusClient {
2935 private val LOGGER = LogManager .getLogger(PolyPlusConstants .NAME )
@@ -68,6 +74,21 @@ object PolyPlusClient {
6874
6975 refresh()
7076 PolyPlusConfig .addDefaultCommand(PolyPlusConstants .ID )
77+ .then(OmniClientCommands .literal(" refresh" )
78+ .executes { ctx ->
79+ refresh()
80+ LOGGER .info(" PolyPlus Client refresh triggered via command." )
81+ val text = Text .literal(" PolyPlus will refresh in the background." )
82+ .setStyle(MCTextStyle .color(TextColors .GREEN ))
83+ ctx.source.replyChat(text)
84+ })
85+ .then(OmniClientCommands .literal(" version" )
86+ .executes { ctx ->
87+ val text = Text .literal(" PolyPlus Client version: ${PolyPlusConstants .VERSION } " )
88+ .setStyle(MCTextStyle .color(TextColors .AQUA ))
89+ ctx.source.replyChat(text)
90+ })
91+ .apply (OmniClientCommands ::register)
7192 }
7293
7394 fun refresh () {
0 commit comments