mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
chore:
- Extracted child style seed derivation to deriveChildStyleSeed Ref.: https://github.com/VolmitSoftware/Iris/issues/1251
This commit is contained in:
+5
-2
@@ -83,8 +83,7 @@ public class IrisDimensionCarvingEntry {
|
||||
public CNG getChildrenGenerator(long seed, IrisData data) {
|
||||
return childGenerators.computeIfAbsent(deriveChildrenGeneratorSeed(seed), key -> {
|
||||
double scale = Math.max(0.0001D, getChildShrinkFactor());
|
||||
RNG random = new RNG(key);
|
||||
return getChildStyle().create(random.nextParallelRNG(2137), data).bake().scale(scale).bake();
|
||||
return getChildStyle().create(deriveChildStyleSeed(key), data).bake().scale(scale).bake();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,6 +91,10 @@ public class IrisDimensionCarvingEntry {
|
||||
return worldSeed ^ (hashOfId() << 32) ^ 2137L;
|
||||
}
|
||||
|
||||
static RNG deriveChildStyleSeed(long childrenGeneratorSeed) {
|
||||
return new RNG(childrenGeneratorSeed).nextParallelRNG(2137);
|
||||
}
|
||||
|
||||
private long hashOfId() {
|
||||
String entryId = getId();
|
||||
return entryId == null ? 0L : entryId.trim().hashCode();
|
||||
|
||||
Reference in New Issue
Block a user