Player rendering in the inventory

This commit is contained in:
2026-10-12 00:11:40 -03:00
parent fbef1d96d2
commit e1f3fda692
7 changed files with 242 additions and 13 deletions
+3 -2
View File
@@ -77,10 +77,11 @@ export function player_menu(inventories: ClientInventories): ClientMenu {
const row = Math.floor(i / 9);
slots.push(slot(inventories.inventory, i, 7 + (i % 9) * 18, i < 9 ? 141 : 83 + (row - 1) * 18));
}
// the crafting grid on the right, the player drawn left of it, see GuiPlayerInventory
for (let i = 0; i < CRAFTING_RESULT_SLOT; i++) {
slots.push(slot(inventories.crafting, i, 25 + (i % 3) * 18, 16 + Math.floor(i / 3) * 18));
slots.push(slot(inventories.crafting, i, 79 + (i % 3) * 18, 16 + Math.floor(i / 3) * 18));
}
slots.push(slot(inventories.crafting, CRAFTING_RESULT_SLOT, 115, 34, true));
slots.push(slot(inventories.crafting, CRAFTING_RESULT_SLOT, 151, 34, true));
if (slots.length !== PLAYER_MENU_EXTRA) throw new Error("menu 0 has the wrong slots");
for (const [i, info] of inventories.extra_slots.entries()) {
slots.push({ ...slot(inventories.extra, i, info.x, info.y, info.output === true), icon: info.icon });