Gestor de forja

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 implementa las siguientes interfaces. 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(nombre como String, datos como crafttweaker.api.data.IData);
smithing.addJSONRecipe("recipe_name", {ingredient:{item:<item:minecraft:gold_ore>.registryName},resultado:<item:minecraft:cooked_porkchop>.registryName,experience:0.35 como float, cookkingtime:100});
ParameterTypeDescription
nameStringname of the recipe
datacrafttweaker.api.data.IDatadata representing the json file

addRecipe

Añade una receta a la mesa de forjado.

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
recipeNameStringNombre de la receta.
resultcrafttweaker.api.item.IItemStackEl objeto creado por la receta.
basecrafttweaker.api.item.IIngredientEl ingrediente inicial de la receta.
añadircrafttweaker.api.item.IIngredientEl elemento añadido al elemento 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

Obtener recetas por salida

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

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

removeAll

Remove all recipes in this registry

smithing.removeAll();

removeByModid

Remove recipe based on Registry name modid

smithing.removeByModid(modid as String);
smithing.removeByModid("minecraft");
ParameterTypeDescription
modidStringmodid of the recipes to remove

Quitar receta basada en la modificación del nombre del registro con una comprobación de exclusión añadida, por lo que puede eliminar todo el mod además de unos pocos especificados.

smithing.removeByModid(modid as String, exclude as crafttweaker.api.recipe.RecipeFilter);
smithing.removeByModid("minecraft", (name as string) => {return name == "orange_wool";});
ParameterTypeDescription
modidStringmodid of the recipes to remove
excluircrafttweaker.api.receta.Recetarecetas para exluir de ser eliminadas.

removeByName

Remove recipe based on Registry name

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

removeByRegex

Remove recipe based on 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