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-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:
status(): usestatus().usable()to tell whether the runtime is usablenutrition(): the player nutrition subsystemcatalog(): recipe and placed-station queriesoperations(): 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 queriesvalue(UUID,type): the current value, falling back to the configured defaultadd,remove,set: mutate the cached value; live player data must respect the player owner threadapplyFood(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 onlymatchRecipe(stationType,input,player): single-input matching; a non-null player needs its owner thread. Wok and fermentation multi-input recipes returnREJECTEDrather than pretending a single item can matchstationAt(Location): location owner thread; an unknown position isNOT_FOUNDand is never reinterpreted as a wokrecentStation(UUID): the most recent station location recorded byCookingStationInteractEvent
Operations
createOutputs(stationType,recipeId): builds every detached success output for the recipe without rolling chance; when some outputs fail to build it returnsPartial<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