Something went wrong. Try again.
(WIP) Modern Minecraft server-side HUD framework.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546package net.hudkit.api.studio
import net.hudkit.api.studio.setup.SetupCallbackimport net.hudkit.api.studio.setup.StudioSetup
/** * An offline "implementation"(-ish) of the StudioAPI. * Used for running Hudkit in offline mode. * * Limitations: * - Always returns a FREE license. * - Project XML must be set manually. * - Setup is not available. * * @param xml The XML string representing the project. */class OfflineStudioAPI(var xml: String) : StudioAPI { override val url: String = "offline" override var key: String? = "offline"
override fun startSetup(callback: SetupCallback): StudioSetup { throw UnsupportedOperationException("Setup is not available in offline mode") }
override fun getLicense(): net.hudkit.api.studio.license.License { return net.hudkit.api.studio.license.License( licenseType = net.hudkit.api.studio.license.License.Type.FREE, expiryDate = null, ) }
override fun getProject(): StudioProject { return StudioProject( id = "offline", xml = xml, ) }
override fun uploadResourcepack(resourcepack: ByteArray): ResourcepackUploadResponse { throw UnsupportedOperationException("Resourcepack upload is not available in offline mode") }
override fun getAsset(name: String): ByteArray { throw UnsupportedOperationException("Asset fetching is not available in offline mode") }}