diff --git a/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonShape.kt b/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonShape.kt index 16a461b..cdc0d66 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonShape.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonShape.kt @@ -1,5 +1,6 @@ package quaedam.projection.swarm +import dev.architectury.platform.Platform import dev.architectury.registry.ReloadListenerRegistry import net.fabricmc.api.EnvType import net.fabricmc.api.Environment @@ -113,12 +114,17 @@ data class ProjectedPersonShape( var skins = emptyList() init { - ReloadListenerRegistry.register(PackType.CLIENT_RESOURCES, ReloadListener, id) + @Environment(EnvType.CLIENT) + if (Platform.getEnv() == EnvType.CLIENT) { + ReloadListenerRegistry.register(PackType.CLIENT_RESOURCES, ReloadListener, id) + } } + @Environment(EnvType.CLIENT) operator fun get(index: Int) = skins[abs(index) % skins.size] fun random(random: Random) = random.nextInt() + @Environment(EnvType.CLIENT) private object ReloadListener : PreparableReloadListener { @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")