More changes, im going to bed

This commit is contained in:
2026-11-06 00:17:27 -03:00
parent 9bec0f3718
commit 7458a2d42a
13 changed files with 35 additions and 53 deletions
+4 -4
View File
@@ -5,7 +5,7 @@
// for each chunk with its block ids. like minecraft's surface rules: a rule gives a block or nothing, and a sequence
// gives its first rule's block
import { type FluidJson, range_test, type SurfaceConditionJson, type SurfaceRuleJson } from "./data.ts";
import type { OverworldTerrain } from "./terrain.ts";
import type { NoiseTerrain } from "./terrain.ts";
// a biome's surface as numeric ids
export interface SurfaceBlocks {
@@ -38,7 +38,7 @@ type Condition = (context: SurfaceContext) => boolean;
export function compile_surface_rule(
json: SurfaceRuleJson,
terrain: OverworldTerrain,
terrain: NoiseTerrain,
block: (id: string) => number,
): Rule {
switch (json.type) {
@@ -68,7 +68,7 @@ export function compile_surface_rule(
}
}
function compile_condition(json: SurfaceConditionJson, terrain: OverworldTerrain): Condition {
function compile_condition(json: SurfaceConditionJson, terrain: NoiseTerrain): Condition {
switch (json.type) {
case "stone_depth": {
const offset = json.offset;
@@ -113,7 +113,7 @@ export function surface_rule_reach(json: SurfaceRuleJson): number {
// the fluid empty space at the context's y becomes, if any. open_sky is whether there's only air above it
export function compile_fluids(
json: FluidJson[],
terrain: OverworldTerrain,
terrain: NoiseTerrain,
block: (id: string) => number,
): (context: SurfaceContext, open_sky: boolean) => number | undefined {
const fluids = json.map((fluid) => {