class
Rosegold::ContainerMenu
- Rosegold::ContainerMenu
- Reference
- Object
Overview
Container menu that acts as a view combining container slots + player inventory. This follows vanilla Minecraft's AbstractContainerMenu approach.
Included Modules
Defined in:
rosegold/inventory/container_menu.crConstructors
Class Method Summary
-
.close(client : Client)
Close current container and return to inventory menu
-
.open(client : Client, container_id : UInt8, title : Chat, type_id : UInt32, container_size : Int32)
Open a new container (following vanilla approach)
Instance Method Summary
-
#[](index : Int32) : Rosegold::Slot
Get slot by absolute index in the container menu
-
#[]=(index : Int32, slot : Rosegold::Slot)
Set slot by absolute index in the container menu
-
#close
Close this container
-
#container_size : Int32
Container size (number of non-player-inventory slots)
-
#container_slots : Array(Rosegold::Slot)
Container-specific slots only
- #content_slots : Array(Rosegold::WindowSlot)
-
#handle_close
Handle container close (vanilla approach)
- #hotbar_slot_index(hotbar_nr : Int32) : Int32
-
#hotbar_slots : Array(Rosegold::WindowSlot)
Player inventory delegation methods
- #id : UInt8
- #inventory_slots : Array(Rosegold::WindowSlot)
-
#menu_id : UInt8
Send container click packet with vanilla client-side logic (matches handleInventoryMouseClick) Abstract methods required by InventoryOperations
-
#offhand_slot_index : Int32
Abstract method implementations for InventoryOperations
-
#player_inventory_slots : Array(Rosegold::Slot)
Player inventory slots (as they appear in this container menu)
- #state_id : UInt32
- #state_id=(state_id : UInt32)
- #title : Chat
-
#total_slots : Int32
Total number of slots in this menu (container + player inventory)
- #type_id : UInt32
-
#update_all_slots(slots : Array(Rosegold::Slot), cursor : Rosegold::Slot, packet_state_id : UInt32)
Override update_all_slots to handle container-specific slot layout
-
#update_container_slots(slots : Array(Rosegold::Slot))
Update all container slots from packet data
Instance methods inherited from module Rosegold::InventoryOperations
[](index : Int32) : Rosegold::Slot
[],
[]=(index : Int32, slot : Rosegold::Slot)
[]=,
allow_modification?(slot_index : Int32) : Bool
allow_modification?,
can_stack?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
can_stack?,
check_and_fix_desync
check_and_fix_desync,
content : Array(Rosegold::WindowSlot)
content,
content_slots : Array(Rosegold::WindowSlot)
content_slots,
copy_slot(slot : Rosegold::Slot) : Rosegold::Slot
copy_slot,
cursor : Rosegold::Slot
cursor,
cursor=(cursor : Rosegold::Slot)
cursor=,
get_max_stack_size(item_slot : Rosegold::Slot) : Int32
get_max_stack_size,
get_slot_max_stack_size(slot_index : Int32, item_slot : Rosegold::Slot) : Int32
get_slot_max_stack_size,
hotbar : Array(Rosegold::WindowSlot)
hotbar,
hotbar_slot_index(hotbar_nr : Int32) : Int32
hotbar_slot_index,
hotbar_slots : Array(Rosegold::WindowSlot)
hotbar_slots,
increment_state_id : UInt32
increment_state_id,
inventory : Array(Rosegold::WindowSlot)
inventory,
inventory_slots : Array(Rosegold::WindowSlot)
inventory_slots,
main_hand : Rosegold::Slot
main_hand,
main_inventory_slots : Array(Rosegold::Slot)
main_inventory_slots,
may_pickup?(slot_index : Int32) : Bool
may_pickup?,
may_place?(slot_index : Int32, item_slot : Rosegold::Slot) : Bool
may_place?,
menu_id : UInt8
menu_id,
move_item_stack_to(source_index : Int32, target_start : Int32, target_end : Int32, reverse : Bool = false) : Bool
move_item_stack_to,
offhand_slot_index : Int32
offhand_slot_index,
perform_cursor_drop_operation(button : Int32)
perform_cursor_drop_operation,
perform_drop_operation(slot_index : Int32, button : Int32)
perform_drop_operation,
perform_hotbar_swap(slot_index : Int32, button : Int32)
perform_hotbar_swap,
perform_offhand_swap_operation(slot_index : Int32)
perform_offhand_swap_operation,
perform_regular_click(slot_index : Int32, button : Int32)
perform_regular_click,
perform_shift_click(slot_index : Int32)
perform_shift_click,
safe_insert(target_slot_index : Int32, cursor_slot : Rosegold::Slot, amount : Int32)
safe_insert,
safe_take(source_slot_index : Int32, amount : Int32)
safe_take,
same_item_same_components?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
same_item_same_components?,
send_click(slot_index : Int32, button : Int32, click_type)
send_click,
slots : Array(Rosegold::WindowSlot)
slots,
slots=(new_slots : Array(Rosegold::WindowSlot))
slots=,
slots_match?(slot1 : Rosegold::Slot, slot2 : Rosegold::Slot) : Bool
slots_match?,
swap_hotbar(hotbar_nr, slot : Rosegold::WindowSlot)swap_hotbar(hotbar_nr, slot_number) swap_hotbar, to_s(io) to_s, total_slots : Int32 total_slots, update_all_slots(slots : Array(Rosegold::Slot), cursor : Rosegold::Slot, packet_state_id : UInt32) update_all_slots, update_slot(index : Int32, slot : Rosegold::Slot, packet_state_id : UInt32) update_slot
Constructor Detail
Class Method Detail
Close current container and return to inventory menu
Open a new container (following vanilla approach)
Instance Method Detail
Get slot by absolute index in the container menu
Set slot by absolute index in the container menu
Player inventory delegation methods
Abstract method implementations for InventoryOperations
Player inventory slots (as they appear in this container menu)
Total number of slots in this menu (container + player inventory)
Override update_all_slots to handle container-specific slot layout
Update all container slots from packet data