Change curios to always show on inventory

This commit is contained in:
2026-10-01 16:35:41 -03:00
parent deba36260e
commit 3dc7d2adee
24 changed files with 244 additions and 159 deletions
+7
View File
@@ -714,6 +714,7 @@ export class GameServer {
Object.assign(player, this.world.spawn_point());
}
this.mods.extend_player_menu(player);
this.#send(player, {
type: "join",
id: player.id,
@@ -723,6 +724,7 @@ export class GameServer {
blocks: this.world.block_table(),
spawn: { x: player.x, y: player.y, z: player.z, yaw: player.yaw, pitch: player.pitch },
selected_slot: player.selected_slot,
player_menu: player.inventory_menu.extra.map(({ x, y, icon }) => ({ x, y, ...(icon ? { icon } : {}) })),
time: this.world.time,
});
this.#players.set(conn, player);
@@ -1525,6 +1527,11 @@ export class GameServer {
sync("crafting", crafting, () => ({ type: "container", container: "crafting", items: crafting }));
const cursor = player.cursor.item?.to_synced_data() ?? null;
sync("cursor", cursor, () => ({ type: "cursor", item: cursor }));
const extra = player.inventory_menu.extra;
if (extra.length > 0) {
const items = extra.map((slot) => slot.container.get_item(slot.index)?.to_synced_data() ?? null);
sync("extra", items, () => ({ type: "container", container: "extra", items }));
}
const { food, saturation } = player.vitals;
const health = player.health;