More or less actual tritanium worm placement configuration
This commit is contained in:
parent
88c3fe24b0
commit
df949a6861
@ -60,8 +60,8 @@ fun registerConfiguredFeatures(context: BootstrapContext<ConfiguredFeature<*, *>
|
|||||||
)
|
)
|
||||||
|
|
||||||
context.register(ConfiguredFeatures.TRITANIUM_ORE, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 9)))
|
context.register(ConfiguredFeatures.TRITANIUM_ORE, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 9)))
|
||||||
//context.register(ConfiguredFeatures.TRITANIUM_ORE_SMALL, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 3)))
|
context.register(ConfiguredFeatures.TRITANIUM_ORE_SMALL, ConfiguredFeature(Feature.ORE, OreConfiguration(target, 3)))
|
||||||
context.register(ConfiguredFeatures.TRITANIUM_ORE_SMALL, ConfiguredFeature(MWorldGenFeatures.DEBUG_PLACEMENT, DebugPlacerFeature.Config(MBlocks.TRITANIUM_ORE.defaultBlockState())))
|
//context.register(ConfiguredFeatures.TRITANIUM_ORE_SMALL, ConfiguredFeature(MWorldGenFeatures.DEBUG_PLACEMENT, DebugPlacerFeature.Config(MBlocks.TRITANIUM_ORE.defaultBlockState())))
|
||||||
}
|
}
|
||||||
|
|
||||||
run {
|
run {
|
||||||
@ -122,9 +122,9 @@ fun registerPlacedFeatures(context: BootstrapContext<PlacedFeature>) {
|
|||||||
chunkScanRange = 24,
|
chunkScanRange = 24,
|
||||||
seedMix = 9284343575495L,
|
seedMix = 9284343575495L,
|
||||||
prePlacementModifiers = listOf(
|
prePlacementModifiers = listOf(
|
||||||
RarityFilter.onAverageOnceEvery(120),
|
RarityFilter.onAverageOnceEvery(240),
|
||||||
InSquarePlacement.spread(),
|
InSquarePlacement.spread(),
|
||||||
HeightRangePlacement.of(StandardDeviationHeightProvider(VerticalAnchor.absolute(120), 15.0)),
|
HeightRangePlacement.of(StandardDeviationHeightProvider(VerticalAnchor.absolute(-40), 15.0)),
|
||||||
),
|
),
|
||||||
postPlacementModifiers = listOf(
|
postPlacementModifiers = listOf(
|
||||||
EllipsoidPlacement(
|
EllipsoidPlacement(
|
||||||
@ -144,7 +144,9 @@ fun registerPlacedFeatures(context: BootstrapContext<PlacedFeature>) {
|
|||||||
turnSpeedXZ = WormPlacement.constantTurnRate(10f),
|
turnSpeedXZ = WormPlacement.constantTurnRate(10f),
|
||||||
turnSpeedXY = WormPlacement.constantTurnRate(4f),
|
turnSpeedXY = WormPlacement.constantTurnRate(4f),
|
||||||
turnChanceXY = BooleanProvider.Unbiased(6),
|
turnChanceXY = BooleanProvider.Unbiased(6),
|
||||||
turnChanceXZ = BooleanProvider.BiasedLinear(0.6f, 5)
|
turnChanceXZ = BooleanProvider.BiasedLinear(0.6f, 5),
|
||||||
|
maxTravelUp = 16,
|
||||||
|
maxTravelDown = 16,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package ru.dbotthepony.mc.otm.worldgen.placement
|
package ru.dbotthepony.mc.otm.worldgen.placement
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec
|
||||||
import com.mojang.serialization.MapCodec
|
import com.mojang.serialization.MapCodec
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder
|
import com.mojang.serialization.codecs.RecordCodecBuilder
|
||||||
import net.minecraft.core.BlockPos
|
import net.minecraft.core.BlockPos
|
||||||
@ -16,6 +17,7 @@ import ru.dbotthepony.mc.otm.core.math.normalizeAngle
|
|||||||
import ru.dbotthepony.mc.otm.core.math.plus
|
import ru.dbotthepony.mc.otm.core.math.plus
|
||||||
import ru.dbotthepony.mc.otm.core.math.toBlockPos
|
import ru.dbotthepony.mc.otm.core.math.toBlockPos
|
||||||
import ru.dbotthepony.mc.otm.core.nextDouble
|
import ru.dbotthepony.mc.otm.core.nextDouble
|
||||||
|
import ru.dbotthepony.mc.otm.data.codec.minRange
|
||||||
import ru.dbotthepony.mc.otm.data.world.BooleanProvider
|
import ru.dbotthepony.mc.otm.data.world.BooleanProvider
|
||||||
import ru.dbotthepony.mc.otm.registry.data.MPlacementModifiers
|
import ru.dbotthepony.mc.otm.registry.data.MPlacementModifiers
|
||||||
import java.util.stream.Stream
|
import java.util.stream.Stream
|
||||||
@ -35,6 +37,8 @@ class WormPlacement(
|
|||||||
val turnRateXZ: FloatProvider,
|
val turnRateXZ: FloatProvider,
|
||||||
val turnRateXY: FloatProvider,
|
val turnRateXY: FloatProvider,
|
||||||
val initialAngleXY: FloatProvider = DEFAULT_INITIAL_ANGLE_XY,
|
val initialAngleXY: FloatProvider = DEFAULT_INITIAL_ANGLE_XY,
|
||||||
|
val maxTravelDown: Int = Int.MAX_VALUE,
|
||||||
|
val maxTravelUp: Int = Int.MAX_VALUE,
|
||||||
) : AbstractEnormousPlacement(parameters) {
|
) : AbstractEnormousPlacement(parameters) {
|
||||||
override fun getPositions(center: BlockPos, random: RandomSource): Stream<BlockPos> {
|
override fun getPositions(center: BlockPos, random: RandomSource): Stream<BlockPos> {
|
||||||
var position = Vector.ZERO
|
var position = Vector.ZERO
|
||||||
@ -102,6 +106,17 @@ class WormPlacement(
|
|||||||
|
|
||||||
// advance worm
|
// advance worm
|
||||||
position += Vector(xzCos, xySin, xzSin)
|
position += Vector(xzCos, xySin, xzSin)
|
||||||
|
|
||||||
|
if (position.y > maxTravelUp) {
|
||||||
|
xyTargetRotation = 0.0
|
||||||
|
xySin = 0.0
|
||||||
|
position = Vector(position.x, maxTravelUp.toDouble(), position.z)
|
||||||
|
} else if (position.y < -maxTravelDown) {
|
||||||
|
xyTargetRotation = 0.0
|
||||||
|
xySin = 0.0
|
||||||
|
position = Vector(position.x, -maxTravelDown.toDouble(), position.z)
|
||||||
|
}
|
||||||
|
|
||||||
val calc = position.toBlockPos()
|
val calc = position.toBlockPos()
|
||||||
|
|
||||||
if (calc != prevPos) {
|
if (calc != prevPos) {
|
||||||
@ -177,6 +192,8 @@ class WormPlacement(
|
|||||||
FloatProvider.CODEC.fieldOf("turn_rate_xz").forGetter(WormPlacement::turnRateXZ),
|
FloatProvider.CODEC.fieldOf("turn_rate_xz").forGetter(WormPlacement::turnRateXZ),
|
||||||
FloatProvider.CODEC.fieldOf("turn_rate_xy").forGetter(WormPlacement::turnRateXY),
|
FloatProvider.CODEC.fieldOf("turn_rate_xy").forGetter(WormPlacement::turnRateXY),
|
||||||
FloatProvider.CODEC.optionalFieldOf("initial_angle_xy", DEFAULT_INITIAL_ANGLE_XY).forGetter(WormPlacement::initialAngleXY),
|
FloatProvider.CODEC.optionalFieldOf("initial_angle_xy", DEFAULT_INITIAL_ANGLE_XY).forGetter(WormPlacement::initialAngleXY),
|
||||||
|
Codec.INT.minRange(1).optionalFieldOf("max_travel_down", Int.MAX_VALUE).forGetter(WormPlacement::maxTravelDown),
|
||||||
|
Codec.INT.minRange(1).optionalFieldOf("max_travel_up", Int.MAX_VALUE).forGetter(WormPlacement::maxTravelUp),
|
||||||
).apply(it, ::WormPlacement)
|
).apply(it, ::WormPlacement)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user