This folder contains the public developer documentation for the EzShops plugin. It provides a centralized reference and short how‑tos for integrating with shop pricing, templates, and the stock market.
- Canonical API reference: docs/api.md
- Shop template how‑to: docs/api/shop-template-api.md
- Shop icon reference: docs/api/shop-icon.md
- Shop pricing reference: docs/api/shop-pricing.md
- Stock API reference: docs/api/stock-api.md
- Class references: docs/api/class/
EzShops exposes three primary public surfaces for integrations:
- Shop pricing: query buy/sell prices for ItemStacks via
ShopPriceService. - Shop templates: create, register and import YAML templates via
ShopTemplateService. - Stock market: real-time stock prices and player holdings via
StockAPI.
Use the unified EzShopsAPI entry point where possible — it is initialized by the plugin and provides convenient helpers for each feature:
EzShopsAPI api = EzShopsAPI.getInstance();
ShopPriceService shop = api.getShopAPI(); // may be null when disabled
ShopTemplateService templates = api.getTemplateAPI();
StockAPI stock = api.getStockAPI(); // may be null when stock disabledIf you must, you may fall back to Bukkit's ServicesManager to look up interfaces directly, but that is considered legacy compared to the EzShopsAPI helpers.
EzShopsAPI.getInstance()throwsIllegalStateExceptionif EzShops has not yet initialized. Call it from your plugin'sonEnable()or later, and catch the exception if uncertain.getShopAPI()andgetTemplateAPI()may returnnullwhen the corresponding features are disabled; always handlenullandOptionalDouble.empty()return values.StockAPIis documented as thread-safe and safe to call from async tasks; prefer async for bulk price operations.- EzShops registers services with Bukkit's
ServicesManager; the plugin'sCoreShopComponenthandles registration in the bootstrap.
EzShopsAPI— docs/api/class/EzShopsAPI.md — entry pointShopPriceService— docs/api/class/ShopPriceService.md — price lookupsShopTemplateService— docs/api/class/ShopTemplateService.md — template managementStockAPI— docs/api/class/StockAPI.md — stock market operationsShopItem,ShopIcon,ShopTemplateBuilderand category builders — see docs/api/class/
Keep examples concise and runnable. When editing API docs, prefer linking to the Java sources in src/main/java for accuracy. If you add examples that rely on templates or resources, include minimal example files under docs/examples or reference src/main/resources/templates/example-template.yml.