Fluid slots and kegs !

This commit is contained in:
2026-10-31 17:35:27 -03:00
parent 65934d34a1
commit 658a6453b7
19 changed files with 494 additions and 34 deletions
+12
View File
@@ -744,6 +744,14 @@ export interface SlotOptions {
max_count?: number;
}
export interface FluidSlotOptions {
// gui pixels from the screen's top left to the slot's 18 pixel frame
x: number;
y: number;
// fluid containers only fill from it, like a machine's output
output_only?: boolean;
}
// what a menu type's build function gets, like neoforge's server menu constructor
export interface MenuBuilder {
title: string;
@@ -751,6 +759,10 @@ export interface MenuBuilder {
open_data: unknown;
// a slot of a container from ctx.containers, or of player.inventory. returns its menu slot index
add_slot(container: Container, slot: number, options: SlotOptions): number;
// a tank of handler, like modern industrialization's fluid slots: the screen draws its fluid in an 18 pixel frame,
// with the amount in its tooltip, and clicking it with a fluid container on the cursor fills that from the tank, or
// else empties it in through the handler. returns its index among the menu's fluid slots
add_fluid_slot(handler: FluidHandler, tank: number, options: FluidSlotOptions): number;
// the player's 36 slots, like addStandardInventorySlots: the rest of the inventory in 3 rows from x and y, the
// hotbar 58 pixels under them. added in inventory order, so inventory slot i is the returned index plus i
add_player_inventory(x: number, y: number): number;