[Fix] New SmithingTransformRecipe crashes EMI

This commit is contained in:
Frank 2023-04-16 18:31:43 +02:00
parent 95f1e2c018
commit 3b1d74f43d

View file

@ -3,11 +3,10 @@ package org.betterx.bclib.recipes;
import org.betterx.bclib.BCLib;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.SmithingTransformRecipeBuilder;
import net.minecraft.data.recipes.LegacyUpgradeRecipeBuilder;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.level.ItemLike;
@ -67,13 +66,20 @@ public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<Smith
@Override
protected void buildRecipe(Consumer<FinishedRecipe> cc) {
final SmithingTransformRecipeBuilder builder = SmithingTransformRecipeBuilder.smithing(
Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
// final SmithingTransformRecipeBuilder builder = SmithingTransformRecipeBuilder.smithing(
// Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
// primaryInput,
// addon,
// category,
// output.getItem()
// );
final LegacyUpgradeRecipeBuilder builder = LegacyUpgradeRecipeBuilder.smithing(
primaryInput,
addon,
category,
output.getItem()
);
for (var item : unlocks.entrySet()) {
builder.unlocks(item.getKey(), item.getValue());
}