Worm bin working with both worms and grubs

This commit is contained in:
2026-10-12 02:22:44 -03:00
parent ff5fb971da
commit df26248f4a
13 changed files with 222 additions and 60 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ export abstract class GuiMenuScreen extends GuiScreen {
// output slots depend on server side things like recipes, and where a shift click goes on slot filters only the
// server has, just wait for the server
if (!slot.output && !shift) {
click_slot(slot.container, slot.index, this.inventories.cursor, button);
click_slot(slot.container, slot.index, this.inventories.cursor, button, slot.max_count);
}
}
}
+8 -1
View File
@@ -15,6 +15,8 @@ export interface ClientSlot {
output: boolean;
// a texture drawn while it's empty, like minecraft's armor slots
icon: string | undefined;
// the most it holds of anything, when that's less than a stack
max_count?: number;
}
export class ClientMenu {
@@ -56,6 +58,7 @@ export class ClientMenu {
y: slot.y,
output: slot.output === true,
icon: slot.icon,
max_count: slot.max_count,
})),
);
}
@@ -84,7 +87,11 @@ export function player_menu(inventories: ClientInventories): ClientMenu {
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 });
slots.push({
...slot(inventories.extra, i, info.x, info.y, info.output === true),
icon: info.icon,
max_count: info.max_count,
});
}
return new ClientMenu(PLAYER_MENU, "", "Crafting", null, slots);
}