GrzybcioRynek

GUI system

InventoryGUI, GUIManager, and market screens — what is in gui.yml vs hardcoded.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

GUI is a normal Bukkit inventory. GUIManager maps open InventoryInventoryHandler. GUIListener forwards click / open / close.

Skeleton

GUIManager.openGUI(gui, player) → registerHandledInventory → player.openInventory GUIListener.onOpen → InventoryGUI.decorate(player) GUIListener.onClick → event.cancel + button consumer (top inventory only) GUIListener.onClose → unregisterInventory

InventoryGUI:

  • createInventory() — size and title;
  • addButton(slot, InventoryButton) — icon creator + click consumer;
  • onClick cancels the event; ignores clicks in the player inventory.

InventoryButton has creator(Player → ItemStack) and consumer(InventoryClickEvent).

Screens (inventory/impl)

ClassOpened by
MarketBrowseGUI/market, /aukcje, search
MarketCategoryGUICategories button
MarketDetailGUIclick listing in browse
MarketConfirmGUIBuy in detail
MyListingsGUI/market my
FavoritesGUI/market favorites
HistoryGUI/market history
MailboxGUI/market mailbox
AlertsGUI/market alerts
StatsGUI/market stats
SellerProfileGUIprofile button in detail

Titles and lore: messages.gui.* in config.yml (via MessageManager). Browse/confirm slot layout: gui.yml (GuiConfigManager).

What is in gui.yml

yaml
browse:
  size: 54                    # actual browse size
  border-slots: [...]
  listing-slots: [10–16, 19–25, 28–34]
  categories:                 # slot + material in MarketCategoryGUI
  pagination: { previous: 39, page: 40, next: 41 }
  filler: { enabled: true, material: BLACK_STAINED_GLASS_PANE }

confirm:
  size: 27
  slots: { confirm: 11, item: 13, cancel: 15 }
  confirm-material / cancel-material
  filler: ...

settings.gui-rows: 6 is loaded (ConfigManager.guiRows) and never used.

Hardcoded browse bar

In MarketBrowseGUI slots 45–53 are fixed in code, not in YAML:

SlotButton
45Search (chat: ChatInputManager)
46Sort (SortMode.next())
47Categories
48Mailbox
49Stats
50Alerts
51Favorites
52My listings
53History
Warning

Moving listing-slots onto 45–53 overlaps the action bar. Empty market with bad slots or no listings / search filter — see GUI.

Data on screen

ListingQueryService.query(BrowseContext, viewer):

  1. all listings from StorageManager;
  2. category filter (MarketCategory.matches);
  3. seller filter;
  4. ItemSearchUtil.matches (material, display, lore, nexo/oraxen ID, nick, #id);
  5. optionally favorites only;
  6. sort SortMode (default NEWEST).

Pagination: listing-slots.length = items per page.

Categories

Enum MarketCategory: ALL, TOOLS, WEAPONS, ARMOR, BLOCKS, FOOD, FARMING, REDSTONE, DECORATIONS, POTIONS, ENCHANTED_BOOKS, OTHER.

Axes (*_AXE) are in WEAPONS, not TOOLS.

Chat instead of Anvil

Search from GUI, alerts, rating, and relist go through ChatInputManager + ChatInputListener. Cancel with: cancel or anuluj.