From 84ca0c2a2424dde49fd14757a815f52b3be09b0e Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 9 Mar 2025 21:47:17 +0700 Subject: [PATCH] Use GJRAND64 for enormous placement --- .../mc/otm/worldgen/placement/EnormousPlacement.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnormousPlacement.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnormousPlacement.kt index 7c84d119e..c5d747d98 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnormousPlacement.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/worldgen/placement/EnormousPlacement.kt @@ -18,6 +18,7 @@ import net.minecraft.world.level.levelgen.placement.PlacementContext import net.minecraft.world.level.levelgen.placement.PlacementModifier import net.minecraft.world.level.levelgen.placement.PlacementModifierType import ru.dbotthepony.kommons.util.XXHash64 +import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource import ru.dbotthepony.mc.otm.core.util.PCG32RandomSource import ru.dbotthepony.mc.otm.data.codec.minRange import ru.dbotthepony.mc.otm.registry.data.MPlacementModifiers @@ -89,7 +90,6 @@ class EnormousPlacement( val bytes = FastByteArrayOutputStream() val dataStream = DataOutputStream(bytes) - dataStream.writeLong(context.level.seed) dataStream.writeLong(seedMix) dataStream.writeInt(pos.x) dataStream.writeInt(pos.z) @@ -97,7 +97,7 @@ class EnormousPlacement( val hash = XXHash64() hash.update(bytes.array, 0, bytes.length) - val random = PCG32RandomSource(hash.digestAsLong()) + val random = GJRAND64RandomSource(context.level.seed, hash.digestAsLong()) var stream = Stream.of(BlockPos(pos.minBlockX, 0, pos.minBlockZ)) children.forEach { modifier -> stream = stream.flatMap { modifier.getPositions(context, random, it).sequential() } } return GeneratedChunk(stream)