本文整理汇总了Java中net.minecraft.server.CraftingManager.a方法的典型用法代码示例。如果您正苦于以下问题:Java CraftingManager.a方法的具体用法?Java CraftingManager.a怎么用?Java CraftingManager.a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.server.CraftingManager
的用法示例。
在下文中一共展示了CraftingManager.a方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToCraftingManager
import net.minecraft.server.CraftingManager; //导入方法依赖的package包/类
public void addToCraftingManager() {
String[] shape = this.getShape();
Map<Character, ItemStack> ingred = this.getIngredientMap();
int width = shape[0].length();
NonNullList<RecipeItemStack> data = NonNullList.withSize(shape.length * width, RecipeItemStack.a);
for (int i = 0; i < shape.length; i++) {
String row = shape[i];
for (int j = 0; j < row.length(); j++) {
data.set(i * width + j, RecipeItemStack.a(new net.minecraft.server.ItemStack[]{CraftItemStack.asNMSCopy(ingred.get(row.charAt(j)))}));
}
}
CraftingManager.a(CraftNamespacedKey.toMinecraft(this.getKey()), new ShapedRecipes("", width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult())));
}
示例2: addToCraftingManager
import net.minecraft.server.CraftingManager; //导入方法依赖的package包/类
public void addToCraftingManager() {
List<ItemStack> ingred = this.getIngredientList();
NonNullList<RecipeItemStack> data = NonNullList.a(ingred.size(), RecipeItemStack.a);
for (int i = 0; i < ingred.size(); i++) {
data.set(i, RecipeItemStack.a(new net.minecraft.server.ItemStack[]{CraftItemStack.asNMSCopy(ingred.get(i))}));
}
CraftingManager.a(CraftNamespacedKey.toMinecraft(this.getKey()), new ShapelessRecipes("", CraftItemStack.asNMSCopy(this.getResult()), data));
}