[Change] SmithingRecipeBuilder
requires a Template Item
This commit is contained in:
parent
d0eaf41356
commit
e656bce991
1 changed files with 17 additions and 9 deletions
|
@ -3,7 +3,7 @@ package org.betterx.bclib.recipes;
|
||||||
import org.betterx.bclib.BCLib;
|
import org.betterx.bclib.BCLib;
|
||||||
|
|
||||||
import net.minecraft.data.recipes.FinishedRecipe;
|
import net.minecraft.data.recipes.FinishedRecipe;
|
||||||
import net.minecraft.data.recipes.LegacyUpgradeRecipeBuilder;
|
import net.minecraft.data.recipes.SmithingTransformRecipeBuilder;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.tags.TagKey;
|
import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
@ -14,6 +14,7 @@ import java.util.function.Consumer;
|
||||||
|
|
||||||
public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<SmithingRecipeBuilder> {
|
public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<SmithingRecipeBuilder> {
|
||||||
protected Ingredient addon;
|
protected Ingredient addon;
|
||||||
|
protected Item template;
|
||||||
|
|
||||||
protected SmithingRecipeBuilder(
|
protected SmithingRecipeBuilder(
|
||||||
ResourceLocation id,
|
ResourceLocation id,
|
||||||
|
@ -26,6 +27,11 @@ public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<Smith
|
||||||
return new SmithingRecipeBuilder(id, output);
|
return new SmithingRecipeBuilder(id, output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SmithingRecipeBuilder setTemplate(Item in) {
|
||||||
|
this.template = in;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param in
|
* @param in
|
||||||
* @return
|
* @return
|
||||||
|
@ -61,19 +67,21 @@ public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<Smith
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (template == null) {
|
||||||
|
BCLib.LOGGER.warning(
|
||||||
|
"Smithing Recipes need a template. Recipe {} will be ignored!",
|
||||||
|
id
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return super.checkRecipe();
|
return super.checkRecipe();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void buildRecipe(Consumer<FinishedRecipe> cc) {
|
protected void buildRecipe(Consumer<FinishedRecipe> cc) {
|
||||||
// final SmithingTransformRecipeBuilder builder = SmithingTransformRecipeBuilder.smithing(
|
final SmithingTransformRecipeBuilder builder = SmithingTransformRecipeBuilder.smithing(
|
||||||
// Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE),
|
Ingredient.of(template),
|
||||||
// primaryInput,
|
|
||||||
// addon,
|
|
||||||
// category,
|
|
||||||
// output.getItem()
|
|
||||||
// );
|
|
||||||
final LegacyUpgradeRecipeBuilder builder = LegacyUpgradeRecipeBuilder.smithing(
|
|
||||||
primaryInput,
|
primaryInput,
|
||||||
addon,
|
addon,
|
||||||
category,
|
category,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue