English
Public API
Compile-time dependency
xml
<repositories><repository><id>jiuwu-releases</id><url>https://repo.crypticlib.com/repository/maven-public/</url></repository></repositories>
<dependency><groupId>emaki.jiuwu.craft</groupId><artifactId>emaki-strengthen-api</artifactId><version>4.8.7</version><scope>provided</scope></dependency>kotlin
repositories { maven("https://repo.crypticlib.com/repository/maven-public/") }
dependencies { compileOnly("emaki.jiuwu.craft:emaki-strengthen-api:4.8.7") }Compile only — never install, shade, or relocate this jar
The runtime embeds the same API classes; duplicate identities break event listeners and the bridge
The public entry points are EmakiStrengthenApi.status().usable(), catalog(), operations(), and mastery(). install, uninstall, and Bridge are internal
catalog() reads StrengthenState, recipe tables, previews, and success rate. Recipe tables are any-thread; live stacks use their holder owner thread, and player previews use the player owner thread. Ineligible state/preview is a successful model value, not an unavailable result
operations() performs owner-thread attempt, attemptEnhancement, transfer, GUI access, item rebuild/refresh, and player refresh. A committed failed roll is Success<AttemptResult> with success()==false; when a cost was taken but compensation is still outstanding the result is Partial. EmakiResult<Unit> is used for GUI access
It also carries the generic-enhancement and bookkeeping surface: registerEnhancementTarget(provider) / unregisterEnhancementTarget(providerId) (re-registering the same id replaces it; removing an unknown id returns NOT_FOUND), enhancementOperation(operationId) / enhancementOperations() for the transaction journal, pityStates(group) / setPityCounter(scope, group, ownerKey, counter) / clearPityGroup(group) (scope is player or item), and setMastery(item, totalExp) / clearMastery(item) for the mastery layer
When a recipe is no longer loaded, rebuild is stricter than refreshItem: rebuild returns NOT_FOUND, while refreshItem returns Partial
mastery() returns the read-only ItemMastery layer: snapshot(ItemStack) and snapshot(Player, ItemStack) both yield EmakiResult<ItemMasteryView>, and every parameter is nullable. It falls back to an unavailable implementation when the bridge or its mastery provider is absent. Mastery writes live on operations() instead, as setMastery(ItemStack, double) and clearMastery(ItemStack)
Use optionalValue() to consume Success or Partial. Failure kinds are UNAVAILABLE, NOT_FOUND, INVALID_INPUT, REJECTED, CANCELLED, TARGET_OFFLINE, WRONG_THREAD, and INTERNAL_ERROR