diff --git a/build.gradle.kts b/build.gradle.kts index 1add8d0..27eba51 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,8 +53,6 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") - implementation("com.liamxsage:KlassicX:2024.7.13-18.48") - compileOnly(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) } diff --git a/src/client/kotlin/com/liamxsage/shaderapi/client/ShaderReceivePayloadHandler.kt b/src/client/kotlin/com/liamxsage/shaderapi/client/ShaderReceivePayloadHandler.kt index 9bd2c73..e0e0202 100644 --- a/src/client/kotlin/com/liamxsage/shaderapi/client/ShaderReceivePayloadHandler.kt +++ b/src/client/kotlin/com/liamxsage/shaderapi/client/ShaderReceivePayloadHandler.kt @@ -1,6 +1,6 @@ package com.liamxsage.shaderapi.client -import com.liamxsage.klassicx.extensions.getLogger +import com.liamxsage.shaderapi.Constants.logger import com.liamxsage.shaderapi.ShaderReceivePayload import com.liamxsage.shaderapi.client.config.ConfigManager import com.liamxsage.shaderapi.client.config.ShaderPackAcceptState @@ -16,7 +16,7 @@ import java.util.* class ShaderReceivePayloadHandler : ClientPlayNetworking.PlayPayloadHandler { override fun receive(payload: ShaderReceivePayload, context: ClientPlayNetworking.Context) { - getLogger().info("ShaderReceivePayload received") + logger.info("ShaderReceivePayload received") val shaderUrl: String = payload.shaderUrl ?: return val shaderHash: String = payload.hash ?: return val serverGroup: String = payload.serverGroup.ifEmpty { context.player().server?.serverIp ?: "global" } @@ -66,7 +66,7 @@ class ShaderReceivePayloadHandler : ClientPlayNetworking.PlayPayloadHandler - ClientPlayNetworking.send(ShaderRequestPayload(true)).also { getLogger().info("ShaderRequestPayload sent") } + ClientPlayNetworking.send(ShaderRequestPayload(true)).also { logger.info("ShaderRequestPayload sent") } }) - getLogger().info("Loading config") + logger.info("Loading config") ConfigManager.readConfig() - getLogger().info("ShaderAPI Client initialized") + logger.info("ShaderAPI Client initialized") } private fun shouldDisableMod(): Boolean { @@ -41,7 +41,7 @@ class ShaderapiClient : ClientModInitializer { try { Class.forName("net.irisshaders.iris.Iris") } catch (e: ClassNotFoundException) { - getLogger().warn("ShaderAPI Client could not find Iris, disabling") + logger.warn("ShaderAPI Client could not find Iris, disabling") return true } diff --git a/src/client/kotlin/com/liamxsage/shaderapi/client/config/ConfigManager.kt b/src/client/kotlin/com/liamxsage/shaderapi/client/config/ConfigManager.kt index a769cd4..972d89f 100644 --- a/src/client/kotlin/com/liamxsage/shaderapi/client/config/ConfigManager.kt +++ b/src/client/kotlin/com/liamxsage/shaderapi/client/config/ConfigManager.kt @@ -2,7 +2,7 @@ package com.liamxsage.shaderapi.client.config import com.google.gson.Gson import com.google.gson.reflect.TypeToken -import com.liamxsage.klassicx.extensions.getLogger +import com.liamxsage.shaderapi.Constants.logger import net.minecraft.client.MinecraftClient import java.io.File @@ -19,9 +19,9 @@ object ConfigManager { fun readConfig() { try { serverGroups = Gson().fromJson(configFile.readText(), object : TypeToken>() {}.type) - getLogger().info("Loaded ${serverGroups.size} server groups") + logger.info("Loaded ${serverGroups.size} server groups") } catch (e: Exception) { - getLogger().warn("Failed to read config file", e) + logger.warn("Failed to read config file", e) } } @@ -29,7 +29,7 @@ object ConfigManager { try { configFile.writeText(Gson().toJson(serverGroups)) } catch (e: Exception) { - getLogger().warn("Failed to save config file", e) + logger.warn("Failed to save config file", e) } } diff --git a/src/main/kotlin/com/liamxsage/shaderapi/Constants.kt b/src/main/kotlin/com/liamxsage/shaderapi/Constants.kt index 1bb98b1..e3cc50b 100644 --- a/src/main/kotlin/com/liamxsage/shaderapi/Constants.kt +++ b/src/main/kotlin/com/liamxsage/shaderapi/Constants.kt @@ -1,6 +1,8 @@ package com.liamxsage.shaderapi import net.minecraft.util.Identifier +import org.slf4j.Logger +import org.slf4j.LoggerFactory object Constants { @JvmStatic @@ -8,4 +10,7 @@ object Constants { @JvmStatic val RECEIVE_SHADER_PACKET_ID: Identifier = Identifier.of("shaderapi", "receive_shader_url") + + @JvmStatic + val logger: Logger = LoggerFactory.getLogger(Shaderapi::class.java) } diff --git a/src/main/kotlin/com/liamxsage/shaderapi/Shaderapi.kt b/src/main/kotlin/com/liamxsage/shaderapi/Shaderapi.kt index 21a828d..23f81f0 100644 --- a/src/main/kotlin/com/liamxsage/shaderapi/Shaderapi.kt +++ b/src/main/kotlin/com/liamxsage/shaderapi/Shaderapi.kt @@ -1,6 +1,6 @@ package com.liamxsage.shaderapi -import com.liamxsage.klassicx.extensions.getLogger +import com.liamxsage.shaderapi.Constants.logger import net.fabricmc.api.ModInitializer import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry @@ -8,11 +8,11 @@ import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry class Shaderapi : ModInitializer { override fun onInitialize() { - getLogger().info("Initializing ShaderAPI") + logger.info("Initializing ShaderAPI") PayloadTypeRegistry.playC2S().register(ShaderRequestPayload.ID, ShaderRequestPayload.CODEC) PayloadTypeRegistry.playS2C().register(ShaderReceivePayload.ID, ShaderReceivePayload.CODEC) - getLogger().info("ShaderAPI initialized") + logger.info("ShaderAPI initialized") } }