Search in sources :

Example 1 with ShapelessRecipeJsonBuilder

use of net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder in project frame-fabric by moddingplayground.

the class AbstractRecipeGenerator method shapeless.

public ShapelessRecipeJsonBuilder shapeless(ItemConvertible[] from, ItemConvertible to, int count) {
    ShapelessRecipeJsonBuilder factory = ShapelessRecipeJsonBuilder.create(to, count).input(Ingredient.ofItems(from));
    for (ItemConvertible itemC : from) {
        Item item = itemC.asItem();
        String itemId = Registry.ITEM.getId(item).getPath();
        factory.criterion("has_" + itemId, hasItem(itemC));
    }
    return factory;
}
Also used : Item(net.minecraft.item.Item) ShapelessRecipeJsonBuilder(net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder) ItemConvertible(net.minecraft.item.ItemConvertible)

Aggregations

ShapelessRecipeJsonBuilder (net.minecraft.data.server.recipe.ShapelessRecipeJsonBuilder)1 Item (net.minecraft.item.Item)1 ItemConvertible (net.minecraft.item.ItemConvertible)1