Dimension api

This commit is contained in:
2026-11-05 23:34:43 -03:00
parent 34f001285d
commit 4766c9a808
14 changed files with 251 additions and 27 deletions
+5 -3
View File
@@ -124,10 +124,12 @@ Deno.test("the server loads every .cubi in its folder, dependencies first, and p
assertEquals(copy.scripts.worldgen, undefined, "players get the world from the server, not its generator");
assertEquals(copy.scripts.shared, mod.mod.scripts.shared, "players run the shared rules too");
// the terrain's data stays on the server too, the rest is the same
const { noises, density_functions, noise_settings, biome_sources, ...data } = mod.mod.data;
assertEquals(copy.data, { ...data, noises: [], density_functions: [], noise_settings: [], biome_sources: [] });
const { noises, density_functions, noise_settings, biome_sources, dimensions, ...data } = mod.mod.data;
const none = { noises: [], density_functions: [], noise_settings: [], biome_sources: [], dimensions: [] };
assertEquals(copy.data, { ...data, ...none });
if (mod.listing.id === "bworld") {
assert([noises, density_functions, noise_settings, biome_sources].every((list) => list!.length > 0));
const terrain = [noises, density_functions, noise_settings, biome_sources, dimensions];
assert(terrain.every((list) => list!.length > 0));
}
}
assert(mods[1].mod.scripts.server, "the server still has it");