StoneCutterManager

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.recipe.StoneCutterManager;

Description

Implements

StoneCutterManager implements the following interfaces:

IRecipeManager<StonecutterRecipe>,CommandStringDisplayable

Undocumented Interfaces

Comparable<Enum>,Iterable<Recipe>

Enum Constants

StoneCutterManager is an enum with 1 constant. It is accessible like so:

script.zs
StoneCutterManager.INSTANCE

Members

addJsonRecipe(name as string, mapData as MapData)
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 RecipeType systems.
script.zs
// StoneCutterManager.addJsonRecipe(name as string, mapData as MapData);
stoneCutter.addJsonRecipe("recipe_name", {
ingredient: <item:minecraft:gold_ore>,
result: <item:minecraft:cooked_porkchop>.registryName,
experience: 0.35 as float,
cookingtime:100
});

Parameters:

name Type: string - name of the recipe
mapData Type: MapData - data representing the json file
addRecipe(recipeName as string, output as IItemStack, input as IIngredient)
Adds a recipe to the stone cutter
script.zs
// StoneCutterManager.addRecipe(recipeName as string, output as IItemStack, input as IIngredient);
stoneCutter.addRecipe("recipe_name", <item:minecraft:grass>, <tag:items:minecraft:wool>);

Parameters:

recipeName Type: string - name of the recipe
output Type: IItemStack - output IItemStack
input Type: IIngredient - input IIngredient
Getter
script.zs
// StoneCutterManager.allRecipes as List<Recipe>
stoneCutter.allRecipes

Return Type: List<Recipe>

allRecipes() as List<Recipe>
script.zs
// StoneCutterManager.allRecipes() as List<Recipe>;
stoneCutter.allRecipes();

Return Type: List<Recipe>

Getter
Returns the BEP to get this thingy
script.zs
// StoneCutterManager.commandString as string
stoneCutter.commandString

Return Type: string

commandString() as string
Returns the BEP to get this thingy
script.zs
// StoneCutterManager.commandString() as string;
stoneCutter.commandString();

Return Type: string

getRecipeByName(name as string) as Recipe?
script.zs
// StoneCutterManager.getRecipeByName(name as string) as Recipe?;
stoneCutter.getRecipeByName(myString);

Parameters:

name Type: string

Return Type: Recipe?

getRecipesByOutput(output as IIngredient) as List<Recipe>
script.zs
// StoneCutterManager.getRecipesByOutput(output as IIngredient) as List<Recipe>;
stoneCutter.getRecipesByOutput(myIIngredient);

Parameters:

output Type: IIngredient

Return Type: List<Recipe>

Getter
Returns a map of all known recipes.
script.zs
// StoneCutterManager.recipeMap as Recipe[ResourceLocation]
stoneCutter.recipeMap

Return Type: Recipe[ResourceLocation]

recipeMap() as Recipe[ResourceLocation]
Returns a map of all known recipes.

Returns: A Map of recipe name to recipe of all known recipes.

script.zs
// StoneCutterManager.recipeMap() as Recipe[ResourceLocation];
stoneCutter.recipeMap();

Return Type: Recipe[ResourceLocation]

remove(output as IIngredient)
Remove a recipe based on it's output.
script.zs
// StoneCutterManager.remove(output as IIngredient);
stoneCutter.remove(<tag:items:minecraft:wool>);

Parameters:

output Type: IIngredient - output of the recipe
removeAll()
Remove all recipes in this registry
script.zs
// StoneCutterManager.removeAll();
stoneCutter.removeAll();
removeByInput(input as IItemStack)
Removes all recipes where the input contains the given IItemStack.
script.zs
// StoneCutterManager.removeByInput(input as IItemStack);
stoneCutter.removeByInput(<item:minecraft:iron_ingot>);

Parameters:

input Type: IItemStack - The input IItemStack.
removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on Registry name modid
script.zs
// StoneCutterManager.removeByModid(modid as string, exclude as function(t as string) as bool = (name as string) as bool => false);
stoneCutter.removeByModid("minecraft", myPredicate);

Parameters:

modid Type: string - modid of the recipes to remove
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false

removeByName(names as string[])
Remove recipes based on Registry names
script.zs
// StoneCutterManager.removeByName(names as string[]);
stoneCutter.removeByName(myString[]);

Parameters:

names Type: string[] - registry names of recipes to remove
removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false)
Remove recipe based on regex with an added exclusion check, so you can remove the whole mod besides a few specified.
script.zs
// StoneCutterManager.removeByRegex(regex as string, exclude as function(t as string) as bool = (name as string) as bool => false);
stoneCutter.removeByRegex("\\d_\\d", (name as string) => {return name == "orange_wool";});

Parameters:

regex Type: string - regex to match against
exclude (optional) Type: function(t as string) as bool

Default Value: (name as string) as bool => false