Skip to content

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 timestamp

PDC Data Structure

Gem data is stored on the equipment item via PDC. Data travels with the item.

FieldTypeDescription
item_definition_idStringEquipment template ID
opened_slotsList<Integer>List of opened socket indexes
socket_assignmentsMapSocket index → gem instance (contains gem_id, level, updated_at)
updated_atLongLast update timestamp

Released under the GPL-3.0 License