pumpkin-plugin-wit/v0.1/gui.wit
Alexander Medvedev 41d8c71c65 first commit
2026-05-19 17:43:50 +02:00

64 lines
1.6 KiB
Plaintext

interface gui {
use text.{text-component};
use common.{click-type};
use item-stack.{item-stack};
enum gui-type {
generic-9x1,
generic-9x2,
generic-9x3,
generic-9x4,
generic-9x5,
generic-9x6,
generic-3x3,
crafter-3x3,
anvil,
beacon,
blast-furnace,
brewing-stand,
crafting,
enchantment,
furnace,
grindstone,
hopper,
lectern,
loom,
merchant,
shulker-box,
smithing,
smoker,
cartography-table,
stonecutter,
}
resource gui {
constructor(%type: gui-type, title: text-component);
set-item: func(slot: u32, item: item-stack);
get-item: func(slot: u32) -> option<item-stack>;
/// Returns the type of this GUI.
get-type: func() -> gui-type;
/// Returns the title of this GUI.
get-title: func() -> text-component;
/// Returns the number of slots in this GUI.
get-size: func() -> u32;
/// Clears all items from the GUI.
clear-items: func();
/// Sets whether players can grab items out of the inventory.
set-allow-grab-items: func(allow: bool);
/// Returns whether players can grab items out of the inventory.
get-allow-grab-items: func() -> bool;
/// Sets whether players can put items into the inventory from their own.
set-allow-put-items: func(allow: bool);
/// Returns whether players can put items into the inventory from their own.
get-allow-put-items: func() -> bool;
}
}