API & Integration
Data Models
GemState
GemState is the gem state data stored in the equipment's PDC, recording all socket opening and inlay information:
java
public record GemState(
String itemDefinitionId, // Equipment template ID
Set<Integer> openedSlotIndexes, // Set of opened socket indexes
Map<Integer, GemItemInstance> socketAssignments, // Socket → inlaid gem instance
long updatedAt // Last update timestamp
)GemItemInstance
Each gem inlaid in a socket is represented by GemItemInstance:
java
public record GemItemInstance(
String gemId, // Gem definition ID
int level, // Gem level
long updatedAt // Inlay/upgrade timestamp
)Reading Gem Data via PdcService
java
PdcService pdcService = EmakiServiceRegistry.get(PdcService.class);
Map<String, Object> auditMap = pdcService.readAuditMap(itemStack, "gem");
// auditMap contains:
// - "item_definition_id": Equipment template ID
// - "opened_slots": List of opened socket indexes
// - "socket_assignments": Socket → gem instance mapping
// - "updated_at": Last update timestampPDC Data Structure
Gem data is stored on the equipment item via PDC. Data travels with the item.
| Field | Type | Description |
|---|---|---|
item_definition_id | String | Equipment template ID |
opened_slots | List<Integer> | List of opened socket indexes |
socket_assignments | Map | Socket index → gem instance (contains gem_id, level, updated_at) |
updated_at | Long | Last update timestamp |