This commit is contained in:
2026-11-13 20:02:38 -03:00
parent e8ca9753f5
commit f95d036f72
7 changed files with 570 additions and 386 deletions
+17
View File
@@ -66,6 +66,8 @@ export interface NoiseSettingsJson {
terrain: { density: DensityJson; cell_height: number };
// solid only where both terrain and caves are above 0
caves: { density: DensityJson; cell_height: number };
// tunnels cut out after caves, see carvers.ts
carvers?: CarverJson[];
// the ground's height before 3d noise, for surface rules, biomes and finding things far away
preliminary_surface: DensityJson;
// named values biome rules read, like temperature
@@ -78,6 +80,14 @@ export interface NoiseSettingsJson {
surface_rule: SurfaceRuleJson;
}
export interface CarverJson {
// the chance a chunk has tunnels starting in it
probability: number;
// where they start
min_y: number;
max_y: number;
}
export interface FluidJson {
block: string;
// only below this y
@@ -303,6 +313,13 @@ const noise_settings_schema: z.ZodType<NoiseSettingsJson> = z.object({
cell_width: z.literal([1, 2, 4, 8, 16]),
terrain: z.object({ density, cell_height }),
caves: z.object({ density, cell_height }),
carvers: z.array(
z.object({
probability: z.number().min(0).max(1),
min_y: z.int().min(LOWEST_Y).max(HIGHEST_Y),
max_y: z.int().min(LOWEST_Y).max(HIGHEST_Y),
}).refine((carver) => carver.min_y <= carver.max_y, "min_y can't be above max_y"),
).optional(),
preliminary_surface: density,
climate: z.record(
z.string(`isn't a name a climate value can have: lowercase letters and _, but not ${RULE_NAMES.join(", ")}`)