diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBuiltInRegistries.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBuiltInRegistries.kt index 4a2577f6e..e25efe5f1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBuiltInRegistries.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBuiltInRegistries.kt @@ -56,7 +56,9 @@ object MBuiltInRegistries { } val FEATURE by Delegate(MRegistries.FEATURE) - val PLACEMENT_MODIFIER by Delegate(MRegistries.PLACEMENT_MODIFIER) + val PLACEMENT_MODIFIER by Delegate(MRegistries.PLACEMENT_MODIFIER) { + defaultKey(ResourceLocation(OverdriveThatMatters.MOD_ID, "passthrough")) + } internal fun register(bus: IEventBus) { delegates.forEach { bus.addListener(it::build) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/EnhancedPlacedFeature.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/EnhancedPlacedFeature.kt index 0e58a43c5..3b002d3df 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/EnhancedPlacedFeature.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/EnhancedPlacedFeature.kt @@ -233,6 +233,8 @@ object EnhancedPlacedFeature : Feature( private val children = ArrayList() private val contents: Either>> + constructor() : this(EnhancedPlacementModifier.Passthrough) + constructor(root: EnhancedPlacementModifier) { this.root = null this.contents = Either.left(root) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnhancedPlacementModifier.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnhancedPlacementModifier.kt index 4cf2d005b..f9c3858ed 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnhancedPlacementModifier.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnhancedPlacementModifier.kt @@ -39,11 +39,23 @@ interface EnhancedPlacementModifier { } } + object Passthrough : EnhancedPlacementModifier, Type { + override fun evaluate(context: EnhancedPlacementContext, positions: Set): Set { + return positions + } + + override val type: Type<*> + get() = this + + override val codec: MapCodec = MapCodec.unit(this) + } + companion object { private val registrar = MDeferredRegister(MRegistries.PLACEMENT_MODIFIER) init { registrar.register("wrapper") { Wrapper.Companion } + registrar.register("passthrough") { Passthrough } } val CODEC: Codec by lazy {