Remove duplicate code
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
// world generation as data: noises, density functions, noise settings (a generator) and biome sources, see
|
||||
// docs/modding/worldgen/terrain.md. checked here, compiled by density.ts and generator.ts. the names follow
|
||||
// minecraft's (density functions, the noise router, surface rules) where the idea is the same
|
||||
import { ID_PATTERN, TAG_ID_PATTERN } from "../mod_data.ts";
|
||||
import { ID_PATTERN, is_object, TAG_ID_PATTERN } from "../mod_data.ts";
|
||||
|
||||
// ids of worldgen data can have folders, like "bworld:overworld/erosion"
|
||||
export const WORLDGEN_ID_PATTERN = TAG_ID_PATTERN;
|
||||
@@ -540,7 +540,3 @@ function block_id(value: unknown, field: string, refs: WorldgenRefs, problems: s
|
||||
if (typeof value === "string" && ID_PATTERN.test(value)) refs.blocks.add(value);
|
||||
else problems.push(`${field} must be a block's id`);
|
||||
}
|
||||
|
||||
function is_object(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null && !Array.isArray(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user