Fix #824 noise settings preview in 1.18
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

This commit is contained in:
Misode
2026-02-01 00:16:10 +01:00
parent f243be3d5e
commit 39f4ecc504

View File

@@ -282,7 +282,7 @@ export class Deepslate {
this.settingsCache = settings.noise
const randomState = new this.d.RandomState(settings, seed)
return randomState.router.finalDensity
} else {
} else if (this.isVersion('1.18.2')) {
const random = this.d.XoroshiroRandom.create(seed).forkPositional()
const settings = this.d.NoiseSettings.fromJson({
min_y: minY,
@@ -297,6 +297,8 @@ export class Deepslate {
this.settingsCache = settings
const originalFn = this.d.DensityFunction.fromJson(state)
return originalFn.mapAll(new (this.d.NoiseRouter as any).Visitor(random, settings))
} else {
return undefined
}
}