Engine entity work
This commit is contained in:
@@ -38,8 +38,11 @@ export async function start_game(
|
||||
expose_engine({ common: common_engine(), server: server_engine() });
|
||||
|
||||
const recipes = register_mod_data(mods.map((mod) => ({ id: mod.listing.id, data: mod.data })));
|
||||
const runtime = new ModRuntime();
|
||||
for (const mod of mods) {
|
||||
for (const json of mod.data.entities) register_entity_type(json.id, mod_entity_factory(json));
|
||||
for (const json of mod.data.entities) {
|
||||
register_entity_type(json.id, mod_entity_factory(json, runtime.entity_behaviors));
|
||||
}
|
||||
}
|
||||
|
||||
const dimension = default_dimension(mods);
|
||||
@@ -59,7 +62,6 @@ export async function start_game(
|
||||
const problem = cell_height_problem(shape, [terrain.cell_height, caves.cell_height]);
|
||||
if (problem) throw new Error(`dimension ${dimension.id} can't be generated by ${generator}: ${problem}`);
|
||||
|
||||
const runtime = new ModRuntime();
|
||||
// before the world loads, its mobs can have effects
|
||||
set_effect_types(runtime.effect_types());
|
||||
const game = new GameServer(host, save, default_seed, {
|
||||
|
||||
Reference in New Issue
Block a user