diff --git a/build.gradle.kts b/build.gradle.kts index 5762b09..3b3f55f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ plugins { } group = "dev.nyon" -val majorVersion = "1.1.1" +val majorVersion = "1.1.2" val mcVersion = "1.20.4" version = "$majorVersion-$mcVersion" val authors = listOf("btwonion") diff --git a/changelog.md b/changelog.md index fc9e553..4ede5be 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +1 @@ -- cleanup code -- make mod only usable on multiplayer servers, that also have this mod +- fix bug causing crash on server diff --git a/src/main/kotlin/dev/nyon/bbm/config/Config.kt b/src/main/kotlin/dev/nyon/bbm/config/Config.kt index 84408f2..6182a57 100644 --- a/src/main/kotlin/dev/nyon/bbm/config/Config.kt +++ b/src/main/kotlin/dev/nyon/bbm/config/Config.kt @@ -3,8 +3,10 @@ package dev.nyon.bbm.config import dev.nyon.bbm.serverConfig import kotlinx.serialization.Serializable import kotlinx.serialization.Transient +import net.fabricmc.api.EnvType import net.fabricmc.fabric.api.networking.v1.FabricPacket import net.fabricmc.fabric.api.networking.v1.PacketType +import net.fabricmc.loader.api.FabricLoader import net.minecraft.client.Minecraft import net.minecraft.network.FriendlyByteBuf import net.minecraft.resources.ResourceLocation @@ -43,6 +45,7 @@ data class Config( } fun getActiveConfig(): Config? { + if (FabricLoader.getInstance().environmentType == EnvType.SERVER) return config if (Minecraft.getInstance().isSingleplayer) return config return serverConfig }