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
+10 -5
View File
@@ -7,7 +7,7 @@ export const AIR_ID = "bworld:air";
// bump when a client and server of different versions can't play together.
// the server rejects a different version before the client downloads anything
export const PROTOCOL_VERSION = 14;
export const PROTOCOL_VERSION = 15;
export interface PlayerInfo {
id: string;
@@ -52,16 +52,19 @@ export type EntityEvent = "hurt" | "death" | "swing";
// x, y, z, block id, and its state bits when they aren't 0
export type BlockChange = [number, number, number, string, number?];
// the player's own containers, synced to them whether or not a menu is open
export type ContainerKey = "inventory" | "crafting";
// the player's own containers, synced to them whether or not a menu is open. "extra" is what's in the slots mods added
// to menu 0, like curios', in their order
export type ContainerKey = "inventory" | "crafting" | "extra";
export const CRAFTING_RESULT_SLOT = 9;
// menus, like neoforge's: the server's menu decides what every click does, clients draw it and send clicks by menu
// slot index. menu 0 is the player's own inventory and crafting grid, always there and never opened or sent, like
// minecraft's InventoryMenu: slots 0-35 are the inventory (the hotbar is 0-8), 36-45 the crafting grid
// slot index. menu 0 is the player's own inventory and crafting grid, always there and never opened, like minecraft's
// InventoryMenu: slots 0-35 are the inventory (the hotbar is 0-8), 36-45 the crafting grid, then the slots mods added,
// which join's player_menu lists
export const PLAYER_MENU = 0;
export const PLAYER_MENU_CRAFTING = 36;
export const PLAYER_MENU_EXTRA = 46;
// one slot of an opened menu as the client draws it. x and y in gui pixels from the screen's top left, output slots
// can only be taken from, icon is a texture drawn while it's empty
@@ -134,6 +137,8 @@ export type ServerMessage =
blocks: string[];
spawn: { x: number; y: number; z: number; yaw: number; pitch: number };
selected_slot: number;
// the slots mods added to menu 0, from PLAYER_MENU_EXTRA on, see ctx.menus.extend_player_menu
player_menu: MenuSlotInfo[];
// world time in ticks, see common/time.ts
time: number;
}