diff --git a/common/src/main/kotlin/quaedam/Quaedam.kt b/common/src/main/kotlin/quaedam/Quaedam.kt index 157e29c..a61fed5 100644 --- a/common/src/main/kotlin/quaedam/Quaedam.kt +++ b/common/src/main/kotlin/quaedam/Quaedam.kt @@ -36,6 +36,7 @@ object Quaedam { fun init() { Projector + ProjectionEffectType SkylightProjection SwarmProjection diff --git a/common/src/main/kotlin/quaedam/projection/ProjectionEffect.kt b/common/src/main/kotlin/quaedam/projection/ProjectionEffect.kt index 0be05b7..7fa50e1 100644 --- a/common/src/main/kotlin/quaedam/projection/ProjectionEffect.kt +++ b/common/src/main/kotlin/quaedam/projection/ProjectionEffect.kt @@ -9,7 +9,6 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.server.level.ServerLevel import net.minecraft.world.level.Level import net.minecraft.world.level.block.state.BlockState -import quaedam.projection.swarm.SwarmProjection abstract class ProjectionEffect { @@ -39,14 +38,22 @@ data class ProjectionEffectType(val constructor: () -> T) val registryKey: ResourceKey>> = ResourceKey.createRegistryKey(ResourceLocation("quaedam", "projection_effect")) - val registry: Registry> = BuiltInRegistries.registerSimple(registryKey) { - SwarmProjection.effect.get() - } + val registry: Registry> = BuiltInRegistries.registerSimple(registryKey) { null } + + val nopEffect: ProjectionEffectType = + Registry.register(registry, ResourceLocation("quaedam", "nop"), ProjectionEffectType { NopEffect }) } val id: ResourceLocation by lazy { registry.getResourceKey(this).get().location() } + // To hide the "unable to bootstrap quaedam:projection_effect" error log + object NopEffect : ProjectionEffect() { + override val type get() = nopEffect + override fun toNbt(tag: CompoundTag) {} + override fun fromNbt(tag: CompoundTag) {} + } + } interface ProjectionProvider

{