Skip to content

API Integration

The current version of EmakiGem does not expose a stable public API interface (no EmakiGemApi interface class exists in source). If you need to read gem state or perform socket operations from another plugin, use the approaches below.

  1. Commands: Use /egem inspect or /egem gui for management operations.
  2. PlaceholderAPI: Use %emakigem_mainhand_*% placeholders to read gem state.
  3. PDC reading: Read item PDC data under the emaki_gem namespace directly (requires knowledge of internal format; not guaranteed across versions).
  4. Configuration-driven: Use gems/*.yml, items/*.yml, and config.yml for most needs.

Requirements

yaml
softdepend:
  - EmakiGem

Do not modify player inventories or Bukkit ItemStacks from asynchronous threads.

Internal service boundary

Core service classes in source:

ServiceResponsibility
GemStateServiceRead/write gem state in item PDC.
GemInlayServiceExecute inlay and extraction logic.
GemUpgradeServiceExecute gem upgrade logic.
SocketOpenerServiceExecute socket opening logic.
GemResonanceServiceEvaluate gem resonance effects.
GemGuiServiceManage gem GUI sessions.

These services are held internally by EmakiGemPlugin and are not exposed via Bukkit ServicesManager. If a stable API is added in a future version, this page will be updated.

Thread safety

  • Static config reads can be cached asynchronously, but ItemStack mutations must happen on the main thread.
  • Do not operate on player inventories, world drops, or event objects from async tasks.
  • If you access Gem services via reflection or internal classes, you assume version compatibility risk.

When you do not need an API

  • Fixed gem definitions: use gems/*.yml.
  • Fixed socket templates: use items/*.yml.
  • Player manual socketing: use GUI and commands.
  • Display values only: prefer placeholders.