class

Rosegold::Menu

Inherits Reference / Object

Abstract base for all menu types (player inventory, chest, furnace, etc.) Replaces the previous InventoryOperations module + InventoryMenu/ContainerMenu split.

Constructors

new(client : Rosegold::Client, player_inventory : Rosegold::PlayerInventory)
Source

Instance methods

[](index : Int32) : Rosegold::Slot

Slot access

Source
[]=(index : Int32, slot : Rosegold::Slot)
Source
allow_modification?(slot_index : Int32) : Bool
Source
can_stack?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
Source
check_and_fix_desync
Source
close
Source
container_slots
Source
content
Source
crafting_grid_range

Slot indices for the crafting grid (1..9 for crafting table, 1..4 for player inventory).

Source
crafting_result_move_end

Exclusive end index for moving crafting results into player inventory.

Source
cursor
Source
cursor=(cursor : Rosegold::Slot)
Source
get_max_stack_size(item_slot : Rosegold::Slot) : Int32
Source
get_slot_max_stack_size(slot_index : Int32, item_slot : Rosegold::Slot) : Int32
Source
handle_close
Source
hotbar
Source
hotbar_slot_index(hotbar_nr : Int32) : Int32
Source
hotbar_slots
Source
hotbar_window_slots
Source
inventory
Source
inventory_slots
Source
main_hand
Source
main_inventory_slots
Source
may_pickup?(slot_index : Int32) : Bool
Source
may_place?(slot_index : Int32, item_slot : Rosegold::Slot) : Bool

Slot validation

Source
move_item_stack_to(source_index : Int32, target_start : Int32, target_end : Int32, reverse : Bool = false) : Bool
Source
offhand_slot_index

Slot group accessors

Source
perform_cursor_drop_operation(button : Int32)
Source
perform_drop_operation(slot_index : Int32, button : Int32)
Source
perform_hotbar_swap(slot_index : Int32, button : Int32)
Source
perform_offhand_swap_operation(slot_index : Int32)
Source
perform_regular_click(slot_index : Int32, button : Int32)
Source
perform_shift_click(slot_index : Int32)
Source
player_inventory_slots
Source
player_inventory_start

Player inventory start offset within this menu

Source
player_window_slots
Source
quick_move_stack(slot_index : Int32) : Rosegold::Slot

Shift-click routing (each menu subclass defines where items move)

Source
safe_insert(target_slot_index : Int32, cursor_slot : Rosegold::Slot, amount : Int32)
Source
safe_take(source_slot_index : Int32, amount : Int32)
Source
same_item_same_components?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
Source
send_click(slot_index : Int32, button : Int32, click_type)
Source
send_click(slot_index : Int32, operation : ClickOperation)
Source
slots
Source
slots=(new_slots : Array(Rosegold::WindowSlot))
Source
slots_match?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
Source
state_id
Source
state_id=(state_id : UInt32)
Source
swap_hotbar(hotbar_nr, slot : Rosegold::WindowSlot)
Source
swap_hotbar(hotbar_nr, slot_number)
Source
to_s(io)
Source
total_slots
Source
update_all_slots(slots : Array(Rosegold::Slot), cursor : Rosegold::Slot, packet_state_id : UInt32)
Source
update_slot(index : Int32, slot : Rosegold::Slot, packet_state_id : UInt32)
Source