Search in sources :

Example 1 with ItemConvertible

use of net.minecraft.item.ItemConvertible 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)

Example 2 with ItemConvertible

use of net.minecraft.item.ItemConvertible in project frame-fabric by moddingplayground.

the class AbstractItemModelGenerator method generatedItems.

public void generatedItems(ItemConvertible... items) {
    for (ItemConvertible item : items) {
        Item i = item.asItem();
        this.add(i, this::generatedItem);
    }
}
Also used : Item(net.minecraft.item.Item) ItemConvertible(net.minecraft.item.ItemConvertible)

Aggregations

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