Every recipe type registered from shared scripts
This commit is contained in:
@@ -24,7 +24,7 @@ import { AIR, CHUNK_SIZE, faces, ID_MASK } from "$/common/constants.ts";
|
||||
import { physics } from "$/common/physics.ts";
|
||||
import { clock } from "$/common/time.ts";
|
||||
import { BlockRules } from "$/common/block_rules.ts";
|
||||
import { FluidRules } from "$/common/fluids.ts";
|
||||
import { fluid_exists, FluidRules, same_fluid } from "$/common/fluids.ts";
|
||||
import { interact, item_handler, tank_handler, transfer, use_container } from "./fluid_handlers.ts";
|
||||
import type { SharedContext } from "$/common/mod_api/shared.ts";
|
||||
import { tag_api } from "$/common/tags.ts";
|
||||
@@ -57,7 +57,7 @@ import type {
|
||||
ServerContext,
|
||||
SlotOptions,
|
||||
} from "$/common/mod_api/server.ts";
|
||||
import { ModLoadError, recipe_lookup, shared_recipes_api } from "$/common/mod_loader.ts";
|
||||
import { check_recipe_types, ModLoadError, recipe_lookup, shared_recipes_api } from "$/common/mod_loader.ts";
|
||||
import {
|
||||
argument,
|
||||
block as block_argument,
|
||||
@@ -278,6 +278,7 @@ export class ModRuntime {
|
||||
for (const { mod, version, url, engine_access, config } of scripts) {
|
||||
await loading_mod(mod, engine_access, () => this.#load_shared_script(mod, version, url, config));
|
||||
}
|
||||
check_recipe_types(game.recipes);
|
||||
} finally {
|
||||
this.#shared_setup = false;
|
||||
}
|
||||
@@ -298,6 +299,8 @@ export class ModRuntime {
|
||||
blocks,
|
||||
items: shared_items_api(mod),
|
||||
fluids: {
|
||||
exists: fluid_exists,
|
||||
same: same_fluid,
|
||||
register: (id, rules) => {
|
||||
if (!this.#setting_up) throw new ModLoadError(mod, "rules can only be registered during setup");
|
||||
this.fluid_rules.register(mod, id, rules);
|
||||
|
||||
Reference in New Issue
Block a user