mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-25 21:40:05 +00:00
chore:
- Extracted entry id hashing to hashOfId Ref.: https://github.com/VolmitSoftware/Iris/issues/1251
This commit is contained in:
1 parent
ba4708f2bb
commit
b998ff535a
1 file changed
+6
-2
+6
-2
@@ -81,8 +81,7 @@ public class IrisDimensionCarvingEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CNG getChildrenGenerator(long seed, IrisData data) {
|
public CNG getChildrenGenerator(long seed, IrisData data) {
|
||||||
String entryId = getId();
|
long idHash = hashOfId();
|
||||||
long idHash = entryId == null ? 0L : entryId.trim().hashCode();
|
|
||||||
long generatorSeed = seed ^ (idHash << 32) ^ 2137L;
|
long generatorSeed = seed ^ (idHash << 32) ^ 2137L;
|
||||||
return childGenerators.computeIfAbsent(generatorSeed, key -> {
|
return childGenerators.computeIfAbsent(generatorSeed, key -> {
|
||||||
double scale = Math.max(0.0001D, getChildShrinkFactor());
|
double scale = Math.max(0.0001D, getChildShrinkFactor());
|
||||||
@@ -90,4 +89,9 @@ public class IrisDimensionCarvingEntry {
|
|||||||
return getChildStyle().create(random.nextParallelRNG(2137), data).bake().scale(scale).bake();
|
return getChildStyle().create(random.nextParallelRNG(2137), data).bake().scale(scale).bake();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long hashOfId() {
|
||||||
|
String entryId = getId();
|
||||||
|
return entryId == null ? 0L : entryId.trim().hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user