Fluid containers

This commit is contained in:
2026-10-25 15:02:31 -03:00
parent fc27771a92
commit 26b59a1899
24 changed files with 486 additions and 82 deletions
+2 -3
View File
@@ -11,6 +11,7 @@ import { type Bmod, read_bmod } from "$/common/bmod.ts";
import { get_state_value, set_state_value, shared_items_api } from "$/common/utils.ts";
import { BlockRules } from "$/common/block_rules.ts";
import { FluidRules } from "$/common/fluids.ts";
import { fluid_rules, set_fluid_rules } from "./fluid_rules.ts";
import { covers_face, EMPTY_SHAPE, FULL_SHAPE, is_solid } from "$/common/block_shapes.ts";
import type { SharedContext, SharedWorld } from "$/common/mod_api/shared.ts";
import { tag_api } from "$/common/tags.ts";
@@ -91,8 +92,6 @@ const rules_world: SharedWorld = {
// what the mods' shared scripts registered, run to guess ahead of the server, see common/block_rules.ts
export let block_rules = new BlockRules(run_mod, rules_world.get_block);
// the fluids' rules from shared scripts, the same as the server's, see common/fluids.ts
export let fluid_rules = new FluidRules(run_mod);
// whether shared scripts are being set up, the only time they can register rules
let rules_setup = false;
// whether client scripts are being set up, the only time they can register visuals, since chunk workers are told
@@ -166,7 +165,7 @@ export async function load_client_mods(listings: ModListing[], bmods: Bmod[]) {
// every mod's shared rules first, so client scripts can count on any mod's being there
block_rules = new BlockRules(run_mod, rules_world.get_block);
fluid_rules = new FluidRules(run_mod);
set_fluid_rules(new FluidRules(run_mod));
rules_setup = true;
for (const [i, bmod] of bmods.entries()) {
const code = bmod.scripts.shared;