Move world generation outside the engine and into mods and data files
This commit is contained in:
@@ -61,7 +61,6 @@ import {
|
||||
number,
|
||||
word,
|
||||
} from "$/common/commands.ts";
|
||||
import { estimate_biome } from "$/common/worldgen/overworld.ts";
|
||||
import { biome_ids, get_biome } from "$/common/worldgen/biomes.ts";
|
||||
import type { GameLoop } from "./game_loop.ts";
|
||||
import { update_crafting_result } from "./crafting.ts";
|
||||
@@ -160,7 +159,7 @@ interface SavedTile {
|
||||
export interface GameMods {
|
||||
listings: ModListing[];
|
||||
recipes: RecipeBook;
|
||||
worldgen?: WorldgenSetup;
|
||||
worldgen: WorldgenSetup;
|
||||
runtime: ModRuntime;
|
||||
}
|
||||
|
||||
@@ -1304,7 +1303,7 @@ export class GameServer {
|
||||
for (let dz = -ring; dz <= ring; dz++) {
|
||||
if (Math.max(Math.abs(dx), Math.abs(dz)) !== ring) continue;
|
||||
const [cx, cz] = [x + dx * LOCATE_STEP, z + dz * LOCATE_STEP];
|
||||
const found = estimate_biome(this.world.seed, cx, cz);
|
||||
const found = this.world.estimate_biome(cx, cz);
|
||||
const distance = Math.hypot(dx, dz);
|
||||
if (found.biome === biome && (!best || distance < best.distance)) {
|
||||
best = { x: cx, y: found.y, z: cz, distance };
|
||||
|
||||
Reference in New Issue
Block a user