Fix level being wrong when placing features in-world
This commit is contained in:
parent
2993ae61ca
commit
f74dbbd84a
@ -161,7 +161,7 @@ object EnhancedPlacedFeature : Feature<EnhancedPlacedFeature.Config>(
|
||||
val filtered = positions.subset(pos)
|
||||
|
||||
if (filtered.isNotEmpty()) {
|
||||
any = feature.place(eContext, filtered, positions) || any
|
||||
any = feature.place(eContext.push(context.level()), filtered, positions) || any
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +91,11 @@ class EnhancedPlacementContext {
|
||||
this.parent = parent
|
||||
}
|
||||
|
||||
private constructor(parent: EnhancedPlacementContext, context: WorldGenLevel) {
|
||||
this.state = parent.state.copy(level = context)
|
||||
this.parent = parent
|
||||
}
|
||||
|
||||
fun push(): EnhancedPlacementContext {
|
||||
return EnhancedPlacementContext(this)
|
||||
}
|
||||
@ -102,4 +107,8 @@ class EnhancedPlacementContext {
|
||||
fun <FC : FeatureConfiguration> vanillaFeatureContext(config: FC, position: BlockPos): FeaturePlaceContext<FC> {
|
||||
return FeaturePlaceContext(Optional.empty(), level, generator, random, position, config)
|
||||
}
|
||||
|
||||
fun push(context: WorldGenLevel): EnhancedPlacementContext {
|
||||
return EnhancedPlacementContext(this, context)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user