- Extracted entry id hashing to hashOfId

Ref.: https://github.com/VolmitSoftware/Iris/issues/1251
This commit is contained in:
CeeVeeR committed 2026-10-02 07:27:56 +02:00
1 parent ba4708f2bb
commit b998ff535a
1 file changed
+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();
}
} }