World shape for dimension

This commit is contained in:
2026-11-06 22:49:43 -03:00
parent 7458a2d42a
commit 818ce22dd6
60 changed files with 749 additions and 349 deletions
+4
View File
@@ -3,6 +3,7 @@
import { ClientMessage, EntityInfo, MenuSlotInfo, PlayerInfo, ServerMessage } from "@/common/protocol.ts";
import type { ModListing } from "@/common/mod_loader.ts";
import { WorldShape } from "@/common/world_shape.ts";
import type { Join, ServerSocket, Welcome } from "./handshake.ts";
export class Connection {
@@ -12,6 +13,8 @@ export class Connection {
mods: ModListing[];
// the server's block id for each of its numeric ids, for reading chunks
server_blocks: string[];
// the dimension's height and sky light
shape: WorldShape;
spawn: { x: number; y: number; z: number; yaw: number; pitch: number };
selected_slot: number;
// the slots mods added to menu 0
@@ -27,6 +30,7 @@ export class Connection {
this.name = join.name;
this.mods = welcome.mods;
this.server_blocks = join.blocks;
this.shape = new WorldShape(join.shape);
this.spawn = join.spawn;
this.selected_slot = join.selected_slot;
this.player_menu = join.player_menu;