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
+8 -2
View File
@@ -421,6 +421,9 @@ export interface Player {
readonly held_item: ItemStack | undefined;
// what doesn't fit in the inventory drops at their feet
give_item(id: Id, count?: number, data?: unknown): void;
// one of the held item becomes result, like an empty bucket filling: straight into the hand when it was the last
// one, into the inventory (or at their feet) when there are more
exchange_held(result: ItemStack): void;
send_message(text: string, options?: MessageOptions): void;
// items drawn on them, under a key so each mod keeps its own list, like "bworld:curios". replaces what that key
// had, [] clears it. only items whose json has worn show. not saved: set it again when they join
@@ -525,8 +528,11 @@ export interface ItemApi {
exists(id: Id): boolean;
// every item, in load order
ids(): Id[];
// how many fit in one slot
max_stack(id: Id): number;
// how many fit in one slot, with this data: a full fluid container's can be fewer
max_stack(id: Id, data?: unknown): number;
// how much a fluid container holds when full, in mB, or undefined for an item that isn't one. see
// docs/modding/resources/fluids.md
fluid_capacity(id: Id): number | undefined;
// the tool type it is, like "pickaxe" or "shovel", from the item's "tool"
tool(id: Id): string | undefined;
// what one of it sells for, from the item's "base_sell_value", or undefined if it can't be sold