Gestionnaire de Smithingformat@@0

This class was added by a mod with mod-id crafttweaker. So you need to have this mod installed if you want to use this feature.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.

crafttweaker.api.SmithingManager

Implemented Interfaces

SmithingManager implémente les interfaces suivantes. That means any method available to them can also be used on this class.

Methods

addJSONRecipe

Adds a recipe based on a provided IData. The provided IData should represent a DataPack JSON, this effectively allows you to register recipes for any DataPack supporting IRecipeType systems.

smithing.addJSONRecipe(name as String, data as crafttweaker.api.data.IData);
smithing.addJSONRecipe("recipe_name", {ingredient:{item:<item:minecraft:gold_ore>.registryName},result:<item:minecraft:cooked_porkchop>.registryName,experience:0.35 as float, cookingtime:100});
ParameterTypeDescription
nameStringname of the recipe
datacrafttweaker.api.data.IDatadata representing the json file

addRecipe

Ajoute une recette à la table de forge.

smithing.addRecipe(recipeName as String, result as crafttweaker.api.item.IItemStack, base as crafttweaker.api.item.IIngredient, addition as crafttweaker.api.item.IIngredient);
smithing.addRecipe("recipe_name", <item:minecraft:golden_apple>, <item:minecraft:apple>, <tag:forge:ingots/gold>);
ParameterTypeDescription
recipeNameStringNom du recette.
resultcrafttweaker.api.item.IItemStackL'article créé par la recette.
basecrafttweaker.api.item.IIngredientL'ingrédient initial de la recette.
ajoutcrafttweaker.api.item.IIngredientL'élément ajouté à l'élément de base.

getAllRecipes

Return type: List<crafttweaker.api.recipes.WrapperRecipe>

smithing.getAllRecipes();

getRecipeByName

Return type: crafttweaker.api.recipes.WrapperRecipe

smithing.getRecipeByName(name as String);
ParameterTypeDescription
nameStringNo description provided

Obtenir des recettes par sortie

Return type: List<crafttweaker.api.recipes.WrapperRecipe>

smithing.getRecipesByOutput(output as crafttweaker.api.item.IIngredient);
ParameterTypeDescription
outputcrafttweaker.api.item.IIngredientNo description provided

removeAll

Supprimer toutes les recettes de ce registre.

smithing.removeAll();

Retirer par Modid

Supprimer la recette basée sur la modification du nom du Registre.

smithing.removeByModid(modid as String);
smithing.removeByModid("minecraft");
ParameterTypeDescription
modidStringmodifier les recettes à supprimer

Supprimer la recette basée sur le nom du Registre modifié avec une vérification d'exclusion ajoutée, de sorte que vous pouvez supprimer l'ensemble du mod en plus de quelques spécifiés.

smithing.removeByModid(modid as String, exclude as crafttweaker.api.recipe.RecipeFilter);
smithing.removeByModid("minecraft", (name as string) => {return name == "orange_wool";});
ParameterTypeDescription
modidStringmodifier les recettes à supprimer
exclureformat@@0 crafttweaker.api.recipeFilterdes recettes pour ne plus être enlevées.

removeByName

Supprimer la recette basée sur le nom du Registre.

smithing.removeByName(name as String);
smithing.removeByName("minecraft:furnace");
ParameterTypeDescription
nameStringregistry name of recipe to remove

removeByRegex

Supprimer la recette basée sur la regex.

smithing.removeByRegex(regex as String);
smithing.removeByRegex("\\d_\\d");
ParameterTypeDescription
regexStringregex to match against

removeRecipe

Remove a recipe based on it's output.

smithing.removeRecipe(output as crafttweaker.api.item.IItemStack);
smithing.removeRecipe(<item:minecraft:glass>);
ParameterTypeDescription
outputcrafttweaker.api.item.IItemStackoutput of the recipe

Properties

NameTypeHas GetterHas Setter
commandStringStringtruefalse