SmithingManager

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.

Diese Klasse importieren

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 implementiert die folgenden Schnittstellen. That means any method available to them can also be used on this class.

Methoden

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});
ParameterTypeBeschreibung
nameStringname of the recipe
datacrafttweaker.api.data.IDatadata representing the json file

addRecipe

Fügt dem Schmiedetisch ein Rezept hinzu.

smithing.addRecipe(recipeName as String, result as crafttweaker.api.item.IItemStack, base as craftweaker.api.item.IIngredient, addition as crafttweaker.api.item.IIngredient);
smithing.addRecipe("recipe_name", <item:minecraft:golden_apple>, <item:minecraft:apple>, <tag:forge:ingots/gold>);
ParameterTypeBeschreibung
recipeNameStringName des Rezeptes.
resultcrafttweaker.api.item.IItemStackDas vom Rezept erstellte Element.
basencrafttweaker.api.item.IIngredientDie erste Zutat für das Rezept.
zusatzcrafttweaker.api.item.IIngredientDas Element, das zum Basiselement hinzugefügt wurde.

getAllRecipes

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

smithing.getAllRecipes();

getRecipeByName

Return type: crafttweaker.api.recipes.WrapperRecipe

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

getRecipesByAusgabe

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

smithing.getRecipesByOutput(output as crafttweaker.api.item.IIngredient);
ParameterTypeBeschreibung
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");
ParameterTypeBeschreibung
modidStringmodid of the recipes to remove

Entfernen Sie Rezept basierend auf Registry-Name Modid mit einer zusätzlichen Ausschluss-Prüfung, so dass Sie die ganze Mod neben einigen angegebenen entfernt können.

smithing.removeByModid(modid as String, exclude as crafttweaker.api.recipe.RecipeFilter);
smithing.removeByModid("minecraft", (name as string) => {return name == "orange_wool";});
ParameterTypeBeschreibung
modidStringmodid of the recipes to remove
ausschließencrafttweaker.api.recipe.RecipeFilterzu entfernende Rezepte.

removeByName

Remove recipe based on Registry name

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

removeByRegex

Remove recipe based on regex

smithing.removeByRegex(regex as String);
smithing.removeByRegex("\\d_\\d");
ParameterTypeBeschreibung
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>);
ParameterTypeBeschreibung
outputcrafttweaker.api.item.IItemStackoutput of the recipe

Properties

NameTypeHas GetterHas Setter
commandStringStringtruefalse