Dimension api
This commit is contained in:
@@ -38,10 +38,12 @@ import { type BiomeJson, validate_biome } from "./worldgen/biomes.ts";
|
||||
import {
|
||||
type BiomeSourceJson,
|
||||
type DensityFunctionJson,
|
||||
type DimensionJson,
|
||||
type NoiseJson,
|
||||
type NoiseSettingsJson,
|
||||
validate_biome_source,
|
||||
validate_density_function,
|
||||
validate_dimension,
|
||||
validate_noise,
|
||||
validate_noise_settings,
|
||||
} from "./worldgen/data.ts";
|
||||
@@ -202,6 +204,7 @@ export function read_mod(bytes: Uint8Array, file: string): Mod {
|
||||
validate_biome_source,
|
||||
problems,
|
||||
) as BiomeSourceJson[],
|
||||
dimensions: checked(raw_data.dimensions, "dimensions", validate_dimension, problems) as DimensionJson[],
|
||||
features: checked(raw_data.features, "features", validate_feature, problems) as FeatureJson[],
|
||||
config: raw_data.config,
|
||||
};
|
||||
@@ -223,6 +226,7 @@ export function read_mod(bytes: Uint8Array, file: string): Mod {
|
||||
...data.density_functions!,
|
||||
...data.noise_settings!,
|
||||
...data.biome_sources!,
|
||||
...data.dimensions!,
|
||||
...data.features!,
|
||||
];
|
||||
for (const { id } of [...registered, ...data.loot_tables!, ...data.biomes!, ...worldgen]) {
|
||||
@@ -303,6 +307,7 @@ export function client_copy(mod: Mod): Mod {
|
||||
density_functions: _d,
|
||||
noise_settings: _s,
|
||||
biome_sources: _b,
|
||||
dimensions: _dim,
|
||||
features: _f,
|
||||
config: _c,
|
||||
...data
|
||||
|
||||
Reference in New Issue
Block a user