mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 23:56:51 +00:00
Get project data for worldgen previews
This commit is contained in:
@@ -2,7 +2,7 @@ import { clampedMap } from 'deepslate'
|
||||
import type { mat3 } from 'gl-matrix'
|
||||
import { vec2 } from 'gl-matrix'
|
||||
import { useCallback, useRef, useState } from 'preact/hooks'
|
||||
import { useLocale, useProject, useVersion } from '../../contexts/index.js'
|
||||
import { getWorldgenProjectData, useLocale, useProject, useVersion } from '../../contexts/index.js'
|
||||
import { useAsync } from '../../hooks/index.js'
|
||||
import { fetchRegistries } from '../../services/index.js'
|
||||
import { Store } from '../../Store.js'
|
||||
@@ -27,7 +27,8 @@ export const NoiseSettingsPreview = ({ docAndNode, shown }: PreviewProps) => {
|
||||
|
||||
const { value, error } = useAsync(async () => {
|
||||
const data = safeJsonParse(text) ?? {}
|
||||
await DEEPSLATE.loadVersion(version, {}) // TODO: get project data
|
||||
const projectData = await getWorldgenProjectData(project)
|
||||
await DEEPSLATE.loadVersion(version, projectData)
|
||||
const biomeSource = { type: 'fixed', biome }
|
||||
await DEEPSLATE.loadChunkGenerator(data, biomeSource, seed)
|
||||
const noiseSettings = DEEPSLATE.getNoiseSettings()
|
||||
|
||||
Reference in New Issue
Block a user