This commit is contained in:
2026-09-26 18:06:05 -03:00
parent 01a81b926e
commit e22f12c0b6
12 changed files with 215 additions and 35 deletions
+5 -4
View File
@@ -1032,15 +1032,16 @@ export class GameServer {
}
};
const inventory = player.inventory.to_data();
// with lore, so it's resent when only the lore changed
const inventory = player.inventory.to_synced_data();
sync("inventory", inventory, () => ({ type: "container", container: "inventory", items: inventory }));
const crafting = player.crafting.to_data();
const crafting = player.crafting.to_synced_data();
sync("crafting", crafting, () => ({ type: "container", container: "crafting", items: crafting }));
const cursor = player.cursor.item?.to_data() ?? null;
const cursor = player.cursor.item?.to_synced_data() ?? null;
sync("cursor", cursor, () => ({ type: "cursor", item: cursor }));
if (player.screen) {
const items = player.screen.container.to_data();
const items = player.screen.container.to_synced_data();
sync("screen", items, () => ({ type: "container", container: "screen", items }));
const properties = { ...player.screen.properties };
sync("properties", properties, () => ({ type: "screen_properties", properties }));