Actually implement mod code into server

This commit is contained in:
2026-09-25 23:13:46 -03:00
parent 099811670f
commit 9237152aa1
22 changed files with 1359 additions and 457 deletions
+6 -4
View File
@@ -1,16 +1,18 @@
import { Container, Cursor, ItemData, ItemStack } from "$/common/inventory.ts";
import { PlayerInfo, ScreenLayout } from "$/common/protocol.ts";
import { Tile } from "./world.ts";
export const INVENTORY_SIZE = 9 * 4;
export const CRAFTING_SIZE = 10;
// a screen the server opened for this player, showing a tile's container
// a container screen a mod opened for this player, see ctx.ui.open_container
export interface OpenScreen {
tile: Tile;
container: Container;
layout: ScreenLayout;
properties(): Record<string, number>;
// what the bars show, synced when they change
properties: Record<string, number>;
// what can go into each slot, checked when the player clicks
filters: Map<number, (item: ItemStack) => boolean>;
on_close: (() => void)[];
}
// what's saved about a player between sessions, by name