🍳 custom_recipes#

Generates the custom recipes of the datapack.

beet_default(ctx: Context) → None[source]#

Main entry point for the custom recipes plugin. This plugin handles the generation of custom recipes for the datapack.

Requires a valid definitions in Mem.definitions in order to function properly.

Parameters:

ctx – The beet context.

awakened_forge#

class AwakenedForgeRecipeHandler[source]#

Bases: object

Handler for awakened forge recipe generation.

This class handles the generation of awakened forge recipes.

classmethod routine() → None[source]#

Main routine for awakened forge recipe generation.

stardust_awakened_forge_recipe(
recipe: JsonDict,
item: str,
) → str[source]#

Generate a awakened forge recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe command.

Return type:

str

static stack_predicates(
ingredient: Ingr,
) → list[str][source]#

The item predicate of each stack, of at most 64, the ingredient’s count takes.

generate_recipes() → None[source]#

Generate all pulverizer recipes.

furnace#

NBT_FURNACE_RECIPES: dict[str, type[SmeltingRecipe | BlastingRecipe | SmokingRecipe]] = {'blasting': <class 'stewbeet.core.cls.recipes.recipe.BlastingRecipe'>, 'smelting': <class 'stewbeet.core.cls.recipes.recipe.SmeltingRecipe'>, 'smoking': <class 'stewbeet.core.cls.recipes.recipe.SmokingRecipe'>}[source]#

The cooking types furnace_nbt_recipes handles, and the class reading each.

class FurnaceRecipeHandler[source]#

Bases: object

Handler for furnace NBT recipe generation.

This class handles the generation of custom furnace recipes with NBT data.

classmethod routine() → None[source]#

Main routine for furnace recipe generation.

furnace_nbt_recipe(
recipe: SmeltingRecipe | BlastingRecipe | SmokingRecipe,
result_loot: str,
result_ingr: JsonDict,
) → str[source]#

Generate a furnace NBT recipe.

Parameters:
  • recipe – The recipe data.

  • result_loot – The loot table for the result.

  • result_ingr – The result ingredient.

Returns:

The generated recipe command.

Return type:

str

furnace_xp_reward(
recipe: SmeltingRecipe | BlastingRecipe | SmokingRecipe,
experience: float,
) → str[source]#

Generate a furnace XP reward.

Parameters:
  • recipe – The recipe data.

  • experience – The experience to reward.

Returns:

The generated XP reward command.

Return type:

str

generate_recipes() → None[source]#

Generate all furnace NBT recipes.

write_furnace_recipe(
item: str,
recipe: SmeltingRecipe | BlastingRecipe | SmokingRecipe,
) → None[source]#

Write one cooking recipe of item for furnace_nbt_recipes and its xp reward, noting an ingredient that is vanilla.

pulverizer#

class PulverizerRecipeHandler[source]#

Bases: object

Handler for pulverizer recipe generation.

This class handles the generation of pulverizer recipes.

classmethod routine() → None[source]#

Main routine for pulverizer recipe generation.

simplenergy_pulverizer_recipe(
recipe: PulverizingRecipe,
item: str,
) → str[source]#

Generate a pulverizer recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe command.

Return type:

str

generate_recipes() → None[source]#

Generate all pulverizer recipes.

silent#

smithed#

class SmithedRecipeHandler[source]#

Bases: object

Handler for Smithed Crafter recipe generation.

This class handles the generation of custom recipes using Smithed Crafter.

classmethod routine() → None[source]#

Main routine for Smithed Crafter recipe generation.

smithed_shapeless_recipe(
recipe: CraftingShapelessRecipe,
result_loot: str,
) → str[source]#

Generate a Smithed Crafter shapeless recipe.

Parameters:
  • recipe – The recipe data.

  • result_loot – The loot table for the result.

Returns:

The generated recipe command.

Return type:

str

smithed_shaped_recipe(
recipe: CraftingShapedRecipe,
result_loot: str,
) → str[source]#

Generate a Smithed Crafter shaped recipe.

Note: Shaped recipe predicates must NOT include ‘count’ because smithed.crafter’s input storage omits count for individual slots. Shapeless predicates DO include count (the number of unique ingredient occurrences), which is handled separately.

Parameters:
  • recipe – The recipe data.

  • result_loot – The loot table for the result.

Returns:

The generated recipe command.

Return type:

str

static slot_predicate(
ingredient: Ingr | None,
slot: int,
) → JsonDict[source]#

What a slot of a shaped recipe must hold, air when no ingredient goes there.

Without a count, since smithed.crafter’s input storage omits it for individual slots.

static slot_dump(
predicate: JsonDict,
) → str[source]#

A slot predicate as SNBT, its slot first and as a byte.

>>> SmithedRecipeHandler.slot_dump({"id": "minecraft:air", "Slot": 2})
'{"Slot":2b, "id": "minecraft:air"}'
write_recipe(
item: str,
recipe: CraftingShapedRecipe | CraftingShapelessRecipe,
) → None[source]#

Write one crafting recipe of an item for the Smithed Crafter, needed as soon as an ingredient is a custom item.

generate_recipes() → None[source]#

Generate all Smithed Crafter recipes.

vanilla#

VANILLA_RECIPES: tuple[type[RecipeBase], ...] = (<class 'stewbeet.core.cls.recipes.recipe.CraftingShapelessRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.CraftingShapedRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.SmeltingRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.BlastingRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.SmokingRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.CampfireCookingRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.StonecuttingRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.SmithingTransformRecipe'>, <class 'stewbeet.core.cls.recipes.recipe.SmithingTrimRecipe'>)[source]#

The recipe types vanilla has a recipe file for.

class VanillaRecipeHandler[source]#

Bases: object

Handler for vanilla recipe generation.

This class handles the generation of vanilla recipes (shapeless, shaped, furnace, …).

classmethod routine() → None[source]#

Main routine for vanilla recipe generation.

write_recipe_unlocking() → None[source]#

A function giving every generated recipe, and an advancement unlocking each one when an ingredient or result is held.

vanilla_shapeless_recipe(
recipe: CraftingShapelessRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla shapeless recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

vanilla_shaped_recipe(
recipe: CraftingShapedRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla shaped recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

vanilla_furnace_recipe(
recipe: SmeltingRecipe | BlastingRecipe | SmokingRecipe | CampfireCookingRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla furnace recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

vanilla_stonecutting_recipe(
recipe: StonecuttingRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla stonecutting recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

vanilla_smithing_transform_recipe(
recipe: SmithingTransformRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla smithing transform recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

vanilla_smithing_trim_recipe(
recipe: SmithingTrimRecipe,
item: str,
) → JsonDict[source]#

Generate a vanilla smithing trim recipe.

Parameters:
  • recipe – The recipe data.

  • item – The item to generate the recipe for.

Returns:

The generated recipe.

Return type:

JsonDict

generate_recipes(
override: list[str] | None = None,
) → None[source]#

Generate all vanilla recipes.

Parameters:

override – If set, only generate recipes for this item, with override only. Used to regenerate a specific item.

vanilla_content(
recipe: RecipeBase,
item: str,
) → JsonDict | None[source]#

The vanilla recipe file of a recipe, None when vanilla has no such type or an ingredient is not a plain item.

vanilla_recipe(
recipe: RecipeBase,
item: str,
) → JsonDict[source]#

The vanilla recipe file of one of VANILLA_RECIPES.

write_recipe_file(
name: str,
content: JsonDict,
) → None[source]#

Write a recipe file.

Parameters:
  • name – The name of the recipe.

  • content – The recipe content.

has_plain_ingredients(
recipe: RecipeBase,
) → bool[source]#

Whether every ingredient of a recipe is a plain item, all a vanilla recipe file can name, and a trim has its pattern.