mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
chore:
- Extracted entry id hashing to hashOfId Ref.: https://github.com/VolmitSoftware/Iris/issues/1251
This commit is contained in:
+6
-2
@@ -81,8 +81,7 @@ public class IrisDimensionCarvingEntry {
|
||||
}
|
||||
|
||||
public CNG getChildrenGenerator(long seed, IrisData data) {
|
||||
String entryId = getId();
|
||||
long idHash = entryId == null ? 0L : entryId.trim().hashCode();
|
||||
long idHash = hashOfId();
|
||||
long generatorSeed = seed ^ (idHash << 32) ^ 2137L;
|
||||
return childGenerators.computeIfAbsent(generatorSeed, key -> {
|
||||
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();
|
||||
});
|
||||
}
|
||||
|
||||
private long hashOfId() {
|
||||
String entryId = getId();
|
||||
return entryId == null ? 0L : entryId.trim().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user