StoneCutterManager

这个类由mod-id为crafttweaker的模组添加. 因此,如果要使用此功能,则需要安装此mod。

导入相关包

如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。

crafttweaker.api.StoneCutterManager

已实现的接口

StoneCutterManager implements the following interfaces. 这意味着对这个接口可用的任何方法也可以在此类上使用。

方法

addJSONRecipe #添加JSON配方

基于提供的IData添加配方 提供的 IData 应该代表一个JSON数据包 ,这有效地允许您注册任何支持 IRecipeType 系统的 DataPack配方。

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

addRecipe

Adds a recipe to the stone cutter

stoneCutter.addRecipe(recipeName as String, output as crafttweaker.api.item.IItemStack, input as crafttweaker.api.item.IIngredient);
stoneCutter.addRecipe("recipe_name", <item:minecraft:grass>, <tag:minecraft:wool>);
参数类型描述
recipeNameStringname of the recipe
output(输出)crafttweaker.api.item.IItemStackoutput IItemStack
input(输入)crafttweaker.api.item.IIngredientinput IIngredient

removeAll

Remove all recipes in this registry

stoneCutter.removeAll();

removeByModid

Remove recipe based on Registry name modid

stoneCutter.removeByModid(modid as String);
stoneCutter.removeByModid("minecraft");
参数类型描述
modidStringmodid of the recipes to remove

removeByName

Remove recipe based on Registry name

stoneCutter.removeByName(name as String);
stoneCutter.removeByName("minecraft:furnace");
参数类型描述
nameStringregistry name of recipe to remove

removeByRegex

Remove recipe based on regex

stoneCutter.removeByRegex(regex as String);
stoneCutter.removeByRegex("\\d_\\d");
参数类型描述
regexStringregex to match against

删除合成表

Remove a recipe based on it's output.

stoneCutter.removeRecipe(output as crafttweaker.api.item.IItemStack);
stoneCutter.removeRecipe(<item:minecraft:glass>);
参数类型描述
output(输出)crafttweaker.api.item.IItemStackoutput of the recipe

参数

名称类型可获得可设置
commandStringStringtruefalse