Module init

Repixture Crafting Compatibility

NOTE: This project uses the term ‘registration format’ to refer to the recipe format passed to `minetest.register_craft()`, and ‘alternate format’ to refer to the format returned from `minetest.get_all_craft_recipes()`.

Some of these functions accept either format.

Functions

rp_craftcompat.list_all_recipes () Lists all registered crafting recipes.
rp_craftcompat.item_exists (name) Checks if the specified node/item has been registered.
rp_craftcompat.is_convertable (recipe) Checks if the specified recipe can be converted to Repixture.
rp_craftcompat.sets_equal (set1, set2) Checks if two lists have the same values, but not necessarily in the same order.
rp_craftcompat.tables_equal (table1, table2) Checks if two mapping tables are equal.
rp_craftcompat.convert_recipe (recipe) Converts a recipe to Repixture format.
rp_craftcompat.recipe_exists (recipe) Checks if a recipe already exists.
rp_craftcompat.register_craft (recipe) A helper function to register a crafting recipe.


Functions

rp_craftcompat.list_all_recipes ()
Lists all registered crafting recipes.

Returns:

    A sequence of crafting recipes in alternate format.
rp_craftcompat.item_exists (name)
Checks if the specified node/item has been registered. The empty hand ('') and groups ('group:*') are always considered to exist.

Parameters:

  • name The prefixed item name.

Returns:

    true if the item exists.
rp_craftcompat.is_convertable (recipe)
Checks if the specified recipe can be converted to Repixture.

Parameters:

  • recipe The recipe, in registration format or alternate format.

Returns:

    true if the recipe can be converted.
rp_craftcompat.sets_equal (set1, set2)
Checks if two lists have the same values, but not necessarily in the same order.

Parameters:

  • set1 The first list to compare.
  • set2 The second list to compare.

Returns:

    true if the lists have the same items.
rp_craftcompat.tables_equal (table1, table2)
Checks if two mapping tables are equal.

Parameters:

  • table1 The first table to compare.
  • table2 The second table to compare.

Returns:

    true if the tables are the same.
rp_craftcompat.convert_recipe (recipe)
Converts a recipe to Repixture format.

Parameters:

  • recipe The recipe to convert, in registration format or alternate format.

Returns:

    The same recipe, in Repixture format.
rp_craftcompat.recipe_exists (recipe)
Checks if a recipe already exists.

Parameters:

  • recipe The recipe to check for, in Repixture format.

Returns:

    true if the exact recipe has already been registered.
rp_craftcompat.register_craft (recipe)
A helper function to register a crafting recipe. Registers the recipe to both Minetest and Repixture. This function can be used as a drop-in replacement for `minetest.register_craft()`.

Parameters:

  • recipe A crafting recipe in registration format.
generated by LDoc 1.4.6 Last updated 2023-01-04 19:06:15