GrzybcioRynek

Architecture

MarketPlace 1.0.3 plugin layers and the separate Next.js mock — no HTTP API.

Compatible with: GrzybcioRynek 1.0.3Minecraft 26.2Web 0.1.0

Based on GrzybcioRynek 1.0.3 and web 0.1.0 source.

Tip

Server administrator: it is enough to know that the plugin requires Paper 26.2 + Vault + an economy, and that data lives in plugins/GrzybcioRynek/. Full class graph: Developer → Architecture. Getting started on the server: Getting Started.

The plugin starts in com.example.marketplace.MarketPlace. It first checks the server version, then Vault, then the rest of the managers. The website is not part of this chain.

Plugin startup

java
@Override
public void onEnable() {
    if (!isSupportedServerVersion()) {
        getLogger().severe("GrzybcioRynek działa TYLKO na Paper 26.2!");
        Bukkit.getPluginManager().disablePlugin(this);
        return;
    }
    // ConfigManager, GuiConfigManager, MessageManager
    this.vaultHook = new VaultHook(this);
    if (!vaultHook.isEnabled()) {
        // ponowienie za 20 ticków (1 s) — Essentials / Vault late load
        Bukkit.getScheduler().runTaskLater(this, () -> { /* ... */ }, 20L);
        return;
    }
    finishEnable();
}

finishEnable() assembles custom-item hooks, storage, services, commands, and the expiry timer (every 30 minutes).

Dependency graph (core)

MarketPlace ├── ConfigManager config.yml (settings, fee, flagi) ├── GuiConfigManager gui.yml ├── MessageManager messages.* z config.yml ├── VaultHook ServicesManager Economy ├── NexoHook / OraxenHook refleksja API packów ├── CustomItemsHook klon ItemStack; rebuild tylko przy AIR ├── ExtendedDataStore market-data.yml ├── StorageManager listings.yml ├── AntiAbuseManager ├── MailboxService ├── AlertService ├── StatsManager ├── ListingQueryService ├── ChatInputManager cancel / anuluj ├── MarketManager oferty, zakup, rezerwacje ├── GUIManager otwarte GUI └── MarketAPI init(this)

Commands: MarketCommand (/market), WystawCommand (/wystaw), AukcjeCommand (/aukcje). Listeners: GUIListener, PlayerJoinListener, ChatInputListener. PlaceholderAPI: PlaceholderHook (if the plugin is present).

Market layer

MarketManager creates listings, buys, removes, expires, and refunds. It holds a reservedListings set — a listing mid-purchase. Reload is blocked when that set is not empty.

ListingQueryService filters and sorts listings for the GUI (search, categories).

StorageManager loads / saves listings.yml, creates backups, removes expired listings, and processes the expiry outbox.

ExtendedDataStore holds extended data in market-data.yml: history, favorites, mailbox, alerts, ratings, player stats.

GUI layer

GUIManager + GUIListener handle clicks. Concrete screens include MarketBrowseGUI, MarketDetailGUI, MarketConfirmGUI, MarketCategoryGUI, MyListingsGUI, FavoritesGUI, HistoryGUI, MailboxGUI, AlertsGUI, StatsGUI, SellerProfileGUI.

Note

Browse size: gui.ymlbrowse.size. The browse action bar (slots 45–53) is fixed in MarketBrowseGUI. settings.gui-rows is loaded and does not control the GUI.

Hooks

ClassRole
VaultHookEconomy from ServicesManager; deposits by UUID; format()$X / $X.XX
NexoHookNexoItems.idFromItem / itemFromId + build()
OraxenHookOraxenItems.getIdByItem / exists / getItemById + build()
CustomItemsHookprefers the cloned saved stack
PlaceholderHookidentifier grybciorynek, cache refresh every 20 ticks

Essentials has no hook class. It is only a softdepend in plugin.yml so Vault Economy has time to register.

On-disk data

plugins/GrzybcioRynek/ ├── config.yml ├── gui.yml ├── listings.yml └── market-data.yml

Messages are in config.yml under messages.*. There is no separate messages.yml.

Web — outside the plugin

GrzybcioRynek-main/ ├── PLugin/ kod Paper 1.0.3 ├── Strona/ Next.js 16 — mock UI, brak połączenia └── Wiki/ ta dokumentacja
Danger

There is no HTTP layer. Strona/ does not read listings.yml and does not call the plugin.

🚧 Planned

An HTTP API is not implemented.