Package org.quiltmc.qkl.wrapper.qsl.recipe

Types

Link copied to clipboard
typealias IngredientLike = Any

Currently Kotlin does not have union types, so this is a workaround. An IngredientLike is one of the following:

TODO: Change into a union type if Kotlin (in the future) supports them.

Functions

Link copied to clipboard
fun coerceIngredient(ingredient: IngredientLike): Ingredient

Coerce the given ingredient to an Ingredient object.

Link copied to clipboard
fun foodCookingRecipe(    baseId: Identifier,     group: String,     input: IngredientLike,     result: ItemStack,     experience: Float = 0.0f,     cookTime: Int = 200,     smokerCookTime: Int = cookTime / 2,     campfireCookTime: Int = cookTime * 3): Array<AbstractCookingRecipe>

A more general recipe builder creating three recipes for the primary ways of cooking. These three are returned in an array, in the order of:

Link copied to clipboard
fun EventRegistration.onAddRecipes(consumer: (handler: RecipeLoadingEvents.AddRecipesCallback.RecipeHandler) -> Unit)

Called when recipes are loaded. This is the time to register your own recipes. It is called before onModifyRecipes and onRemoveRecipes.

Link copied to clipboard
fun EventRegistration.onModifyRecipes(consumer: (handler: RecipeLoadingEvents.ModifyRecipesCallback.RecipeHandler) -> Unit)

Called when recipes are modified. This is the time to modify any recipes. It is called after onAddRecipes but before onRemoveRecipes.

Link copied to clipboard
fun EventRegistration.onRemoveRecipes(consumer: (handler: RecipeLoadingEvents.RemoveRecipesCallback.RecipeHandler) -> Unit)

Called when recipes are removed. This is the time to remove any recipes. It is called after onAddRecipes and onModifyRecipes.

Link copied to clipboard
fun <C : Inventory, R : Recipe<C>> registerStaticRecipe(recipe: R): R
Link copied to clipboard
fun registerStaticRecipes(vararg recipes: Recipe<*>)
Link copied to clipboard
fun shapedRecipe(    id: Identifier,     group: String,     pattern: String,     result: ItemStack,     vararg ingredients: Pair<Char, IngredientLike>): ShapedRecipe

Create a new ShapedRecipe with the given information. The group string is used for finding the recipe in the recipe book. The pattern is a newline-separated string of rows. The result is the resulting ItemStack of the recipe. Any ingredients can be listed in the form char to ingredient

Link copied to clipboard
fun shapelessRecipe(    id: Identifier,     group: String,     result: ItemStack,     vararg ingredients: IngredientLike): ShapelessRecipe

Create a new ShapelessRecipe with the given information. The group string is used for finding the recipe in the recipe book. The result is the resulting ItemStack of the recipe. The ingredients are any number of IngredientLike objects.