Skip to content

Commit

Permalink
fix bug causing server crash
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Mar 30, 2024
1 parent 57d9035 commit b25e6d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
- cleanup code
- make mod only usable on multiplayer servers, that also have this mod
- fix bug causing crash on server
3 changes: 3 additions & 0 deletions src/main/kotlin/dev/nyon/bbm/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit b25e6d6

Please sign in to comment.