API Integration
The current version of EmakiGem does not expose a stable public API interface (no
EmakiGemApiinterface class exists in source). If you need to read gem state or perform socket operations from another plugin, use the approaches below.
Recommended integration
- Commands: Use
/egem inspector/egem guifor management operations. - PlaceholderAPI: Use
%emakigem_mainhand_*%placeholders to read gem state. - PDC reading: Read item PDC data under the
emaki_gemnamespace directly (requires knowledge of internal format; not guaranteed across versions). - Configuration-driven: Use
gems/*.yml,items/*.yml, andconfig.ymlfor most needs.
Requirements
yaml
softdepend:
- EmakiGemDo not modify player inventories or Bukkit ItemStacks from asynchronous threads.
Internal service boundary
Core service classes in source:
| Service | Responsibility |
|---|---|
GemStateService | Read/write gem state in item PDC. |
GemInlayService | Execute inlay and extraction logic. |
GemUpgradeService | Execute gem upgrade logic. |
SocketOpenerService | Execute socket opening logic. |
GemResonanceService | Evaluate gem resonance effects. |
GemGuiService | Manage 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.