mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Give stages WorldRandom, a SplitMix64 generator whose every method IrisApi defines
java.util.Random fixes only some of its methods; the ranged RandomGenerator defaults module authors reach for are left to the JDK, so an update could change existing worlds. WorldRandom does not implement RandomGenerator and exposes a curated set (ints, longs, ranges, booleans, floats, doubles, gaussian, chance) with Lemire bounds and the polar gaussian on StrictMath. StageContext, ObjectGenerationContext and BlockPalette now use it. StageRandom becomes StageStreams; the seed derivation is unchanged. Every method is pinned to values from an independent Python reference in src/test/reference.
This commit is contained in:
1 parent
d5aad57ad9
commit
1ce0a19abb
17 files changed
+653
-48
No files matched your search
@@ -4,12 +4,12 @@ import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.generation.GenerationContext;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.mantle.Mantle;
|
||||
import com.volmit.random.WorldRandom;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.stage.Stage;
|
||||
import com.volmit.world.TerrainSampler;
|
||||
import java.util.Objects;
|
||||
import java.util.random.RandomGenerator;
|
||||
|
||||
/** The context every stage of one chunk invocation receives. */
|
||||
final class ChunkInvocation implements ChunkStageContext {
|
||||
@@ -76,7 +76,7 @@ final class ChunkInvocation implements ChunkStageContext {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RandomGenerator random() {
|
||||
public WorldRandom random() {
|
||||
return stages.random();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user