Item entities

This commit is contained in:
2026-09-25 16:26:45 -03:00
parent 5fb23cf404
commit a254b96f65
18 changed files with 797 additions and 94 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
import { BlockChange, ClientMessage, PlayerInfo, ServerMessage } from "$/common/protocol.ts";
import { BlockChange, ClientMessage, EntityInfo, PlayerInfo, ServerMessage } from "$/common/protocol.ts";
import type { ModListing } from "$/common/mod_loader.ts";
import type { Join, ServerSocket, Welcome } from "./handshake.ts";
@@ -13,6 +13,7 @@ export class Connection {
selected_slot: number;
// who was already there when we joined, they become entities in the level
initial_players: PlayerInfo[];
initial_entities: EntityInfo[];
constructor(server: ServerSocket, welcome: Welcome, join: Join) {
this.#server = server;
@@ -24,6 +25,7 @@ export class Connection {
this.spawn = join.spawn;
this.selected_slot = join.selected_slot;
this.initial_players = join.players;
this.initial_entities = join.entities;
}
// handled by the packet listener inside the game loop, not whenever the socket feels like it