Implement main game as a mod
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// messages sent between the client and the server, as json over a websocket
|
||||
import type { Faces } from "./constants.ts";
|
||||
import type { ItemData } from "./inventory.ts";
|
||||
import type { ModListing } from "./mod_loader.ts";
|
||||
|
||||
export const AIR_ID = "bworld:air";
|
||||
|
||||
@@ -58,7 +59,11 @@ export type ServerMessage =
|
||||
| {
|
||||
type: "welcome";
|
||||
id: string;
|
||||
// the server may change the name asked for, like alice to alice2
|
||||
name: string;
|
||||
seed: string;
|
||||
// in load order, the client loads them before joining the world
|
||||
mods: ModListing[];
|
||||
players: PlayerInfo[];
|
||||
changes: BlockChange[];
|
||||
spawn: { x: number; y: number; z: number; yaw: number; pitch: number };
|
||||
@@ -70,6 +75,7 @@ export type ServerMessage =
|
||||
// also sent to the player who caused it, which corrects anything their client predicted wrong
|
||||
| { type: "set_block"; x: number; y: number; z: number; id: string }
|
||||
| { type: "chat"; from?: string; text: string }
|
||||
| { type: "teleport"; x: number; y: number; z: number }
|
||||
| { type: "container"; container: ContainerKey; items: (ItemData | null)[] }
|
||||
| { type: "cursor"; item: ItemData | null }
|
||||
| { type: "open_screen"; layout: ScreenLayout; properties: Record<string, number> }
|
||||
|
||||
Reference in New Issue
Block a user