Refactor generator to prevent duplicate reloading

This commit is contained in:
Misode
2022-05-08 16:24:39 +02:00
parent 2772d967e0
commit a432479672
13 changed files with 78 additions and 75 deletions

View File

@@ -9,7 +9,7 @@ import { BiomeSourcePreview, DecoratorPreview, DensityFunctionPreview, NoisePrev
export const HasPreview = ['dimension', 'worldgen/density_function', 'worldgen/noise', 'worldgen/noise_settings', 'worldgen/configured_feature', 'worldgen/placed_feature']
type PreviewPanelProps = {
model: DataModel | null,
model: DataModel | undefined,
version: VersionId,
id: string,
shown: boolean,

View File

@@ -52,8 +52,8 @@ interface Editor {
type SourcePanelProps = {
name: string,
model: DataModel | null,
blockStates: BlockStateRegistry | null,
model: DataModel | undefined,
blockStates: BlockStateRegistry | undefined,
doCopy?: number,
doDownload?: number,
doImport?: number,

View File

@@ -7,8 +7,8 @@ import type { BlockStateRegistry, VersionId } from '../../services'
type TreePanelProps = {
version: VersionId,
model: DataModel | null,
blockStates: BlockStateRegistry | null,
model: DataModel | undefined,
blockStates: BlockStateRegistry | undefined,
onError: (message: string) => unknown,
}
export function Tree({ version, model, blockStates, onError }: TreePanelProps) {