mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 05:50:39 +00:00
chore:
- Extracted child shrink scaling to scaleByShrinkFactor Ref.: https://github.com/VolmitSoftware/Iris/issues/1251
This commit is contained in:
1 parent
53172c38ad
commit
9e07009f1d
1 file changed
+5
-2
+5
-2
@@ -82,8 +82,7 @@ public class IrisDimensionCarvingEntry {
|
|||||||
|
|
||||||
public CNG getChildrenGenerator(long seed, IrisData data) {
|
public CNG getChildrenGenerator(long seed, IrisData data) {
|
||||||
return childGenerators.computeIfAbsent(deriveChildrenGeneratorSeed(seed), key -> {
|
return childGenerators.computeIfAbsent(deriveChildrenGeneratorSeed(seed), key -> {
|
||||||
double scale = Math.max(0.0001D, getChildShrinkFactor());
|
return scaleByShrinkFactor(getChildStyle().create(deriveChildStyleSeed(key), data));
|
||||||
return getChildStyle().create(deriveChildStyleSeed(key), data).bake().scale(scale).bake();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +94,10 @@ public class IrisDimensionCarvingEntry {
|
|||||||
return new RNG(childrenGeneratorSeed).nextParallelRNG(2137);
|
return new RNG(childrenGeneratorSeed).nextParallelRNG(2137);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CNG scaleByShrinkFactor(CNG generator) {
|
||||||
|
return generator.bake().scale(Math.max(0.0001D, getChildShrinkFactor())).bake();
|
||||||
|
}
|
||||||
|
|
||||||
private long hashOfId() {
|
private long hashOfId() {
|
||||||
String entryId = getId();
|
String entryId = getId();
|
||||||
return entryId == null ? 0L : entryId.trim().hashCode();
|
return entryId == null ? 0L : entryId.trim().hashCode();
|
||||||
|
|||||||
Reference in new issue
Block a user