Better recipe api and port smithing to it
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
ItemStack,
|
||||
ModInfo,
|
||||
Position,
|
||||
RecipeLookup,
|
||||
Season,
|
||||
TagApi,
|
||||
} from "./shared.ts";
|
||||
@@ -641,13 +642,12 @@ export interface ServerFluidApi extends FluidApi {
|
||||
interact(player: Player, handler: FluidHandler): boolean;
|
||||
}
|
||||
|
||||
export interface RecipeApi {
|
||||
// find and all read the recipes of types shared scripts registered
|
||||
export interface RecipeApi extends RecipeLookup {
|
||||
furnace_result(input: Id): { output: ItemStack; cook_time: number } | undefined;
|
||||
fuel_value(item: Id): number; // burn time in ticks, 0 if it isn't fuel
|
||||
is_fuel(item: Id): boolean;
|
||||
is_smeltable(item: Id): boolean;
|
||||
// the smithing recipe for these items, whatever the material's count. addition is the optional third item
|
||||
smithing(tool: Id, material: Id, addition?: Id): { result: Id; material_count: number } | undefined;
|
||||
// every recipe of a mod's own type, like "bworld:cooking", as its json. copies, in load order
|
||||
// deno-lint-ignore no-explicit-any
|
||||
list(type: Id): any[];
|
||||
|
||||
Reference in New Issue
Block a user