Skip to content

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-cooking-api</artifactId><version>4.3.6</version><scope>provided</scope></dependency>
kotlin
repositories { maven("https://repo.crypticlib.com/repository/maven-public/") }
dependencies { compileOnly("emaki.jiuwu.craft:emaki-cooking-api:4.3.6") }

Compile only — never install, shade, or relocate this jar

Do not install, bundle, shade, or relocate the API jar. EmakiCooking-4.3.8.jar already embeds the API classes unrelocated; a second ClassLoader copy breaks event and bridge delivery

EmakiCookingApi exposes four non-null entry points:

  1. status(): use status().usable() to tell whether the runtime is usable
  2. nutrition(): the player nutrition subsystem
  3. catalog(): recipe and placed-station queries
  4. operations(): output construction and completion-condition checks

install, uninstall, and Bridge are for the runtime lifecycle only. Nutrition can be switched off independently by configuration; a usable API does not imply nutrition().enabled() is true, and a disabled subsystem rejects business calls with REJECTED

Nutrition ​

  • enabled(), types(), type(id): definition queries
  • value(UUID,type): the current value, falling back to the configured default
  • add, remove, set: mutate the cached value; live player data must respect the player owner thread
  • applyFood(Player,ItemStack), recheckThresholds(Player): player owner thread, and they fire the matching nutrition events

Catalog ​

  • recipes(stationType) / recipe(stationType,id): loaded recipes for the seven station types. Ids are matched case-insensitively within one station loader only
  • matchRecipe(stationType,input,player): single-input matching; a non-null player needs its owner thread. Wok and fermentation multi-input recipes return REJECTED rather than pretending a single item can match
  • stationAt(Location): location owner thread; an unknown position is NOT_FOUND and is never reinterpreted as a wok
  • recentStation(UUID): the most recent station location recorded by CookingStationInteractEvent

Operations ​

  • createOutputs(stationType,recipeId): builds every detached success output for the recipe without rolling chance; when some outputs fail to build it returns Partial<List<ItemStack>>
  • completionConditionPasses(recipeId,player): player owner thread. Because the signature carries no station type, a recipe id duplicated across station loaders is rejected as ambiguous; Success(false) is a legitimate business result

The public API does not run station ticks or deliver rewards itself; it offers genuinely answerable catalog queries, output construction, and condition evaluation

Result semantics ​

Payload-free operations return EmakiResult<Unit>; the generic optional-payload accessor is optionalValue(). FailureKind is exactly UNAVAILABLE, NOT_FOUND, INVALID_INPUT, REJECTED, CANCELLED, TARGET_OFFLINE, WRONG_THREAD, INTERNAL_ERROR