How itzamirreza/ezchestshop works
Project Type and Purpose
• This is a Java‑based Bukkit/Spigot plugin (EzChestShop) for Minecraft servers.
• It provides chest‑based shop mechanics, command‑driven configuration, GUI menus, event handling, and persistent storage via SQLite or MySQL.
• It also includes version‑specific adapter modules for different CraftBukkit/Spigot server versions (1.16 through 1.20).
Key Architectural Elements
a. Plugin Core Module
• Main entry point (EzChestShop.java)
• Command handlers (commands/)
• Event listeners (listeners/)
• Task schedulers (tasks/)
• GUI management (guis/, data/gui/)
• Data layer (Config, LanguageManager, DatabaseManager, PlayerContainer, ShopContainer)
• Database adapters: SQLite (data/sqlite/) and MySQL (data/mysql/)
• Utilities (utils/) such as holograms, pair objects, update checker, webhook sender
• Third‑party library embedded: tr.zeltuv.ezql for SQL abstraction
b. Version Adapter Modules
• Separate Maven submodules for each supported server version (craftbukkit_1_16_R3, …, craftbukkit_1_20_R3)
• Each provides version‑specific implementations of APIs (ChannelHandler, MenuOpener, ImprovedOfflinePlayer, etc.)
c. External Integrations
• Metrics (bstats) via Metrics.java
• Discord webhooks
• Optional plugin integrations (AdvancedRegionMarket, WorldGuard utilities)
d. Deployment
• Parent pom.xml orchestrates multi‑module build
• dist module packages everything for distribution
• Inside it, place a “Plugin Loader” which instantiates EzChestShop.
• EzChestShop to subcomponents:
• Command Module → MainCommands, EcsAdmin, CommandCheckProfits
• Event Module → all listeners (BlockPlaceListener, PlayerTransactionListener, etc.)
• GUI Module → GUI classes (OwnerShopGUI, AdminShopGUI, ContainerGui, etc.)
• Task Scheduler → LoadedChunksTask, UpdateChecker task
• Data Layer → DatabaseManager
– DatabaseManager branches into SQLite adapter and MySQL adapter
– Both use embedded Ezql library
• Utility Layer → ASHologram, WebhookSender, Utils, VersionUtils, etc.
• Metrics & Update Checker → Metrics.java, UpdateChecker
• Off to the side, show “Integration Services”:
• Discord Webhook endpoint
• bStats metrics endpoint
• Optional plugins: WorldGuard, AdvancedRegionMarket
Architectural Patterns and Principles
• Modular design via Maven multi-module.
• Adapter pattern for server versions.
• Observer/event‑driven model through Bukkit event listeners.
• Command pattern for slash/console commands.
• DAO‑style abstraction for database access (Ezql).
• Separation of concerns: commands, events, data, UI, integrations.