Search in sources :

Example 1 with GenericRecipe

use of com.minecolonies.api.crafting.GenericRecipe in project minecolonies by ldtteam.

the class GenericRecipeUtils method create.

@NotNull
public static IGenericRecipe create(@NotNull final IRecipe<?> recipe) {
    final IGenericRecipe original = Objects.requireNonNull(GenericRecipe.of(recipe));
    final List<List<ItemStack>> inputs = compact(recipe.getIngredients());
    return new GenericRecipe(original.getPrimaryOutput(), original.getAdditionalOutputs(), inputs, original.getGridSize(), original.getIntermediate(), original.getLootTable(), new ArrayList<>(), -1);
}
Also used : IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) GenericRecipe(com.minecolonies.api.crafting.GenericRecipe) NonNullList(net.minecraft.util.NonNullList) IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with GenericRecipe

use of com.minecolonies.api.crafting.GenericRecipe in project minecolonies by Minecolonies.

the class GenericRecipeUtils method create.

@NotNull
public static IGenericRecipe create(@NotNull final IRecipe<?> recipe) {
    final IGenericRecipe original = Objects.requireNonNull(GenericRecipe.of(recipe));
    final List<List<ItemStack>> inputs = compact(recipe.getIngredients());
    return new GenericRecipe(original.getPrimaryOutput(), original.getAdditionalOutputs(), inputs, original.getGridSize(), original.getIntermediate(), original.getLootTable(), new ArrayList<>(), -1);
}
Also used : IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) GenericRecipe(com.minecolonies.api.crafting.GenericRecipe) NonNullList(net.minecraft.util.NonNullList) IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GenericRecipe (com.minecolonies.api.crafting.GenericRecipe)2 IGenericRecipe (com.minecolonies.api.crafting.IGenericRecipe)2 NonNullList (net.minecraft.util.NonNullList)2 NotNull (org.jetbrains.annotations.NotNull)2