use of net.minecraft.data.recipes.FinishedRecipe in project TinkersConstruct by SlimeKnights.
the class ISmelteryRecipeHelper method oreMelting.
/**
* Base logic for {@link #metalMelting(Consumer, Fluid, String, boolean, String, boolean, IByproduct...)}
* @param consumer Recipe consumer
* @param fluid Fluid to melt into
* @param amount Amount to melt into
* @param tagName Input tag
* @param factor Melting factor
* @param recipePath Recipe output name
* @param oreRate Ore rate for boosting
* @param isOptional If true, recipe is optional
* @param byproducts List of byproduct options for this metal, first one that is present will be used
*/
default void oreMelting(Consumer<FinishedRecipe> consumer, Fluid fluid, int amount, String tagName, @Nullable Tag.Named<Item> size, float factor, String recipePath, boolean isOptional, OreRateType oreRate, float byproductScale, IByproduct... byproducts) {
Consumer<FinishedRecipe> wrapped;
Ingredient baseIngredient = Ingredient.of(getTag("forge", tagName));
Ingredient ingredient;
// not everyone sets size, so treat singular as the fallback, means we want anything in the tag that is not sparse or dense
if (size == Tags.Items.ORE_RATES_SINGULAR) {
ingredient = IngredientDifference.difference(baseIngredient, CompoundIngredient.from(Ingredient.of(Tags.Items.ORE_RATES_SPARSE), Ingredient.of(Tags.Items.ORE_RATES_DENSE)));
wrapped = withCondition(consumer, new TagDifferencePresentCondition(new ResourceLocation("forge", tagName), Tags.Items.ORE_RATES_SPARSE.getName(), Tags.Items.ORE_RATES_DENSE.getName()));
// size tag means we want an intersection between the tag and that size
} else if (size != null) {
ingredient = IngredientIntersection.intersection(baseIngredient, Ingredient.of(size));
wrapped = withCondition(consumer, new TagIntersectionPresentCondition(new ResourceLocation("forge", tagName), size.getName()));
// default only need it to be in the tag
} else {
ingredient = baseIngredient;
wrapped = isOptional ? withCondition(consumer, tagCondition(tagName)) : consumer;
}
Supplier<MeltingRecipeBuilder> supplier = () -> MeltingRecipeBuilder.melting(ingredient, fluid, amount, factor).setOre(oreRate);
ResourceLocation location = modResource(recipePath);
// if no byproducts, just build directly
if (byproducts.length == 0) {
supplier.get().save(wrapped, location);
// if first option is always present, only need that one
} else if (byproducts[0].isAlwaysPresent()) {
supplier.get().addByproduct(new FluidStack(byproducts[0].getFluid(), (int) (byproducts[0].getAmount() * byproductScale))).save(wrapped, location);
} else {
// multiple options, will need a conditonal recipe
ConditionalRecipe.Builder builder = ConditionalRecipe.builder();
boolean alwaysPresent = false;
for (IByproduct byproduct : byproducts) {
// found an always present byproduct? no need to tag and we are done
alwaysPresent = byproduct.isAlwaysPresent();
if (alwaysPresent) {
builder.addCondition(TrueCondition.INSTANCE);
} else {
builder.addCondition(tagCondition("ingots/" + byproduct.getName()));
}
builder.addRecipe(supplier.get().addByproduct(new FluidStack(byproduct.getFluid(), (int) (byproduct.getAmount() * byproductScale)))::save);
if (alwaysPresent) {
break;
}
}
// not always present? add a recipe with no byproducts as a final fallback
if (!alwaysPresent) {
builder.addCondition(TrueCondition.INSTANCE);
builder.addRecipe(supplier.get()::save);
}
builder.build(wrapped, location);
}
}
use of net.minecraft.data.recipes.FinishedRecipe in project TinkersConstruct by SlimeKnights.
the class SmelteryRecipeProvider method addAlloyRecipes.
private void addAlloyRecipes(Consumer<FinishedRecipe> consumer) {
String folder = "smeltery/alloys/";
// alloy recipes are in terms of ingots
// tier 3
// slimesteel: 1 iron + 1 skyslime + 1 seared brick = 2
AlloyRecipeBuilder.alloy(TinkerFluids.moltenSlimesteel.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.skySlime.getLocalTag(), FluidValues.SLIMEBALL).addInput(TinkerFluids.searedStone.getLocalTag(), FluidValues.BRICK).save(consumer, prefix(TinkerFluids.moltenSlimesteel, folder));
// amethyst bronze: 1 copper + 1 amethyst = 1
AlloyRecipeBuilder.alloy(TinkerFluids.moltenAmethystBronze.get(), FluidValues.INGOT).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenAmethyst.getLocalTag(), FluidValues.GEM).save(consumer, prefix(TinkerFluids.moltenAmethystBronze, folder));
// rose gold: 3 copper + 1 gold = 4
AlloyRecipeBuilder.alloy(TinkerFluids.moltenRoseGold.get(), FluidValues.INGOT * 4).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenGold.getForgeTag(), FluidValues.INGOT).save(consumer, prefix(TinkerFluids.moltenRoseGold, folder));
// pig iron: 1 iron + 1 blood + 1 clay = 2
AlloyRecipeBuilder.alloy(TinkerFluids.moltenPigIron.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.blood.getLocalTag(), FluidValues.SLIMEBALL).addInput(TinkerFluids.moltenClay.getLocalTag(), FluidValues.BRICK).save(consumer, prefix(TinkerFluids.moltenPigIron, folder));
// obsidian: 1 water + 1 lava = 2
// note this is not a progression break, as the same tier lets you combine glass and copper for same mining level
AlloyRecipeBuilder.alloy(TinkerFluids.moltenObsidian.get(), FluidValues.GLASS_BLOCK / 10).addInput(Fluids.WATER, FluidAttributes.BUCKET_VOLUME / 20).addInput(Fluids.LAVA, FluidAttributes.BUCKET_VOLUME / 10).save(consumer, prefix(TinkerFluids.moltenObsidian, folder));
// tier 4
// queens slime: 1 cobalt + 1 gold + 1 magma cream = 2
AlloyRecipeBuilder.alloy(TinkerFluids.moltenQueensSlime.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenCobalt.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenGold.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.magma.getForgeTag(), FluidValues.SLIMEBALL).save(consumer, prefix(TinkerFluids.moltenQueensSlime, folder));
// manyullyn: 3 cobalt + 1 debris = 3
AlloyRecipeBuilder.alloy(TinkerFluids.moltenManyullyn.get(), FluidValues.INGOT * 4).addInput(TinkerFluids.moltenCobalt.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenDebris.getLocalTag(), FluidValues.INGOT).save(consumer, prefix(TinkerFluids.moltenManyullyn, folder));
// heptazion: 2 copper + 1 cobalt + 1/4 obsidian = 2
AlloyRecipeBuilder.alloy(TinkerFluids.moltenHepatizon.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenCobalt.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenQuartz.getLocalTag(), FluidValues.GEM * 4).save(consumer, prefix(TinkerFluids.moltenHepatizon, folder));
// netherrite: 4 debris + 4 gold = 1 (why is this so dense vanilla?)
ConditionalRecipe.builder().addCondition(ConfigEnabledCondition.CHEAPER_NETHERITE_ALLOY).addRecipe(AlloyRecipeBuilder.alloy(TinkerFluids.moltenNetherite.get(), FluidValues.NUGGET).addInput(TinkerFluids.moltenDebris.getLocalTag(), FluidValues.NUGGET * 4).addInput(TinkerFluids.moltenGold.getForgeTag(), FluidValues.NUGGET * 2)::save).addCondition(// fallback
TrueCondition.INSTANCE).addRecipe(AlloyRecipeBuilder.alloy(TinkerFluids.moltenNetherite.get(), FluidValues.NUGGET).addInput(TinkerFluids.moltenDebris.getLocalTag(), FluidValues.NUGGET * 4).addInput(TinkerFluids.moltenGold.getForgeTag(), FluidValues.NUGGET * 4)::save).build(consumer, prefix(TinkerFluids.moltenNetherite, folder));
// tier 3 compat
Consumer<FinishedRecipe> wrapped;
// bronze
wrapped = withCondition(consumer, tagCondition("ingots/bronze"), tagCondition("ingots/tin"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenBronze.get(), FluidValues.INGOT * 4).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenTin.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenBronze, folder));
// brass
wrapped = withCondition(consumer, tagCondition("ingots/brass"), tagCondition("ingots/zinc"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenBrass.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenZinc.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenBrass, folder));
// electrum
wrapped = withCondition(consumer, tagCondition("ingots/electrum"), tagCondition("ingots/silver"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenElectrum.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenGold.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenSilver.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenElectrum, folder));
// invar
wrapped = withCondition(consumer, tagCondition("ingots/invar"), tagCondition("ingots/nickel"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenInvar.get(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenNickel.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenInvar, folder));
// constantan
wrapped = withCondition(consumer, tagCondition("ingots/constantan"), tagCondition("ingots/nickel"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenConstantan.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenNickel.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenConstantan, folder));
// pewter
wrapped = withCondition(consumer, tagCondition("ingots/pewter"), tagCondition("ingots/lead"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenPewter.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT).addInput(TinkerFluids.moltenLead.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenPewter, folder));
// thermal alloys
Function<String, ICondition> fluidTagLoaded = name -> new NotCondition(new FluidTagEmptyCondition("forge", name));
// enderium
wrapped = withCondition(consumer, tagCondition("ingots/enderium"), tagCondition("ingots/lead"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenEnderium.get(), FluidValues.INGOT * 2).addInput(TinkerFluids.moltenLead.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenDiamond.getLocalTag(), FluidValues.GEM).addInput(TinkerFluids.moltenEnder.getForgeTag(), FluidValues.SLIMEBALL * 2).save(wrapped, prefix(TinkerFluids.moltenEnderium, folder));
// lumium
wrapped = withCondition(consumer, tagCondition("ingots/lumium"), tagCondition("ingots/tin"), tagCondition("ingots/silver"), fluidTagLoaded.apply("glowstone"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenLumium.get(), FluidValues.INGOT * 4).addInput(TinkerFluids.moltenTin.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenSilver.getForgeTag(), FluidValues.INGOT).addInput(FluidIngredient.of(FluidTags.bind("forge:glowstone"), FluidValues.SLIMEBALL * 2)).save(wrapped, prefix(TinkerFluids.moltenLumium, folder));
// signalum
wrapped = withCondition(consumer, tagCondition("ingots/signalum"), tagCondition("ingots/copper"), tagCondition("ingots/silver"), fluidTagLoaded.apply("redstone"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenSignalum.get(), FluidValues.INGOT * 4).addInput(TinkerFluids.moltenCopper.getForgeTag(), FluidValues.INGOT * 3).addInput(TinkerFluids.moltenSilver.getForgeTag(), FluidValues.INGOT).addInput(FluidIngredient.of(FluidTags.bind("forge:redstone"), 400)).save(wrapped, prefix(TinkerFluids.moltenSignalum, folder));
// refined obsidian, note glowstone is done as a composite
wrapped = withCondition(consumer, tagCondition("ingots/refined_obsidian"), tagCondition("ingots/osmium"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenRefinedObsidian.get(), FluidValues.INGOT).addInput(TinkerFluids.moltenObsidian.getLocalTag(), FluidValues.GLASS_PANE).addInput(TinkerFluids.moltenDiamond.getLocalTag(), FluidValues.GEM).addInput(TinkerFluids.moltenOsmium.getForgeTag(), FluidValues.INGOT).save(wrapped, prefix(TinkerFluids.moltenRefinedObsidian, folder));
}
use of net.minecraft.data.recipes.FinishedRecipe in project TinkersConstruct by SlimeKnights.
the class SmelteryRecipeProvider method addSmelteryRecipes.
private void addSmelteryRecipes(Consumer<FinishedRecipe> consumer) {
String folder = "smeltery/seared/";
// grout crafting
ShapelessRecipeBuilder.shapeless(TinkerSmeltery.grout, 2).requires(Items.CLAY_BALL).requires(ItemTags.SAND).requires(Blocks.GRAVEL).unlockedBy("has_item", has(Items.CLAY_BALL)).save(consumer, prefix(TinkerSmeltery.grout, folder));
ShapelessRecipeBuilder.shapeless(TinkerSmeltery.grout, 8).requires(Blocks.CLAY).requires(ItemTags.SAND).requires(ItemTags.SAND).requires(ItemTags.SAND).requires(ItemTags.SAND).requires(Blocks.GRAVEL).requires(Blocks.GRAVEL).requires(Blocks.GRAVEL).requires(Blocks.GRAVEL).unlockedBy("has_item", has(Blocks.CLAY)).save(consumer, wrap(TinkerSmeltery.grout, folder, "_multiple"));
// seared bricks from grout
SimpleCookingRecipeBuilder.smelting(Ingredient.of(TinkerSmeltery.grout), TinkerSmeltery.searedBrick, 0.3f, 200).unlockedBy("has_item", has(TinkerSmeltery.grout)).save(consumer, prefix(TinkerSmeltery.searedBrick, folder));
Consumer<Consumer<FinishedRecipe>> fastGrout = c -> SimpleCookingRecipeBuilder.blasting(Ingredient.of(TinkerSmeltery.grout), TinkerSmeltery.searedBrick, 0.3f, 100).unlockedBy("has_item", has(TinkerSmeltery.grout)).save(c);
ConditionalRecipe.builder().addCondition(new ModLoadedCondition("ceramics")).addRecipe(c -> fastGrout.accept(ConsumerWrapperBuilder.wrap(new ResourceLocation("ceramics", "kiln")).build(c))).addCondition(TrueCondition.INSTANCE).addRecipe(fastGrout).generateAdvancement().build(consumer, wrap(TinkerSmeltery.searedBrick, folder, "_kiln"));
// block from bricks
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedBricks).define('b', TinkerSmeltery.searedBrick).pattern("bb").pattern("bb").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, wrap(TinkerSmeltery.searedBricks, folder, "_from_brick"));
// ladder from bricks
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedLadder, 4).define('b', TinkerSmeltery.searedBrick).define('B', TinkerTags.Items.SEARED_BRICKS).pattern("b b").pattern("b b").pattern("BBB").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, prefix(TinkerSmeltery.searedLadder, folder));
// cobble -> stone
SimpleCookingRecipeBuilder.smelting(Ingredient.of(TinkerSmeltery.searedCobble.get()), TinkerSmeltery.searedStone, 0.1f, 200).unlockedBy("has_item", has(TinkerSmeltery.searedCobble.get())).save(consumer, wrap(TinkerSmeltery.searedStone, folder, "_smelting"));
// stone -> paver
SimpleCookingRecipeBuilder.smelting(Ingredient.of(TinkerSmeltery.searedStone.get()), TinkerSmeltery.searedPaver, 0.1f, 200).unlockedBy("has_item", has(TinkerSmeltery.searedStone.get())).save(consumer, wrap(TinkerSmeltery.searedPaver, folder, "_smelting"));
// stone -> bricks
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedBricks, 4).define('b', TinkerSmeltery.searedStone).pattern("bb").pattern("bb").unlockedBy("has_item", has(TinkerSmeltery.searedStone)).save(consumer, wrap(TinkerSmeltery.searedBricks, folder, "_crafting"));
// bricks -> cracked
SimpleCookingRecipeBuilder.smelting(Ingredient.of(TinkerSmeltery.searedBricks), TinkerSmeltery.searedCrackedBricks, 0.1f, 200).unlockedBy("has_item", has(TinkerSmeltery.searedBricks)).save(consumer, wrap(TinkerSmeltery.searedCrackedBricks, folder, "_smelting"));
// brick slabs -> fancy
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedFancyBricks).define('s', TinkerSmeltery.searedBricks.getSlab()).pattern("s").pattern("s").unlockedBy("has_item", has(TinkerSmeltery.searedBricks.getSlab())).save(consumer, wrap(TinkerSmeltery.searedFancyBricks, folder, "_crafting"));
// bricks or stone as input
this.searedStonecutter(consumer, TinkerSmeltery.searedBricks, folder);
this.searedStonecutter(consumer, TinkerSmeltery.searedFancyBricks, folder);
this.searedStonecutter(consumer, TinkerSmeltery.searedTriangleBricks, folder);
// seared glass
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedGlass).define('b', TinkerSmeltery.searedBrick).define('G', Tags.Items.GLASS_COLORLESS).pattern(" b ").pattern("bGb").pattern(" b ").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, prefix(TinkerSmeltery.searedGlass, folder));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedGlassPane, 16).define('#', TinkerSmeltery.searedGlass).pattern("###").pattern("###").unlockedBy("has_item", has(TinkerSmeltery.searedGlass)).save(consumer, prefix(TinkerSmeltery.searedGlassPane, folder));
// stairs and slabs
this.slabStairsCrafting(consumer, TinkerSmeltery.searedStone, folder, true);
this.stairSlabWallCrafting(consumer, TinkerSmeltery.searedCobble, folder, true);
this.slabStairsCrafting(consumer, TinkerSmeltery.searedPaver, folder, true);
this.stairSlabWallCrafting(consumer, TinkerSmeltery.searedBricks, folder, true);
// tanks
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedTank.get(TankType.FUEL_TANK)).define('#', TinkerSmeltery.searedBrick).define('B', Tags.Items.GLASS).pattern("###").pattern("#B#").pattern("###").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "fuel_tank"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedTank.get(TankType.FUEL_GAUGE)).define('#', TinkerSmeltery.searedBrick).define('B', Tags.Items.GLASS).pattern("#B#").pattern("BBB").pattern("#B#").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "fuel_gauge"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedTank.get(TankType.INGOT_TANK)).define('#', TinkerSmeltery.searedBrick).define('B', Tags.Items.GLASS).pattern("#B#").pattern("#B#").pattern("#B#").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "ingot_tank"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedTank.get(TankType.INGOT_GAUGE)).define('#', TinkerSmeltery.searedBrick).define('B', Tags.Items.GLASS).pattern("B#B").pattern("#B#").pattern("B#B").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "ingot_gauge"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedLantern.get(), 3).define('C', Tags.Items.INGOTS_IRON).define('B', TinkerSmeltery.searedBrick).define('P', TinkerSmeltery.searedGlassPane).pattern(" C ").pattern("PPP").pattern("BBB").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "lantern"));
// fluid transfer
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedFaucet.get(), 3).define('#', TinkerSmeltery.searedBrick).pattern("# #").pattern(" # ").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "faucet"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedChannel.get(), 5).define('#', TinkerSmeltery.searedBrick).pattern("# #").pattern("###").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "channel"));
// casting
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedBasin.get()).define('#', TinkerSmeltery.searedBrick).pattern("# #").pattern("# #").pattern("###").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "basin"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedTable.get()).define('#', TinkerSmeltery.searedBrick).pattern("###").pattern("# #").pattern("# #").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "table"));
// peripherals
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedDrain).define('#', TinkerSmeltery.searedBrick).define('C', Tags.Items.INGOTS_COPPER).pattern("# #").pattern("C C").pattern("# #").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "drain"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedChute).define('#', TinkerSmeltery.searedBrick).define('C', Tags.Items.INGOTS_COPPER).pattern("#C#").pattern(" ").pattern("#C#").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "chute"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedDuct).define('#', TinkerSmeltery.searedBrick).define('C', TinkerMaterials.cobalt.getIngotTag()).pattern("# #").pattern("C C").pattern("# #").unlockedBy("has_item", has(TinkerMaterials.cobalt.getIngotTag())).save(consumer, modResource(folder + "duct"));
// controllers
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedMelter).define('G', Ingredient.of(TinkerSmeltery.searedTank.get(TankType.FUEL_GAUGE), TinkerSmeltery.searedTank.get(TankType.INGOT_GAUGE))).define('B', TinkerSmeltery.searedBrick).pattern("BGB").pattern("BBB").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "melter"));
ShapedRecipeBuilder.shaped(TinkerSmeltery.searedHeater).define('B', TinkerSmeltery.searedBrick).pattern("BBB").pattern("B B").pattern("BBB").unlockedBy("has_item", has(TinkerSmeltery.searedBrick)).save(consumer, modResource(folder + "heater"));
// casting
String castingFolder = "smeltery/casting/seared/";
ItemCastingRecipeBuilder.basinRecipe(TinkerSmeltery.searedStone).setFluidAndTime(TinkerFluids.searedStone, false, FluidValues.BRICK_BLOCK).save(consumer, modResource(castingFolder + "stone/block_from_seared"));
this.ingotCasting(consumer, TinkerFluids.searedStone, FluidValues.BRICK, TinkerSmeltery.searedBrick, castingFolder + "brick");
ItemCastingRecipeBuilder.basinRecipe(TinkerSmeltery.searedGlass).setFluidAndTime(TinkerFluids.searedStone, false, FluidValues.BRICK_BLOCK).setCast(Tags.Items.GLASS_COLORLESS, true).save(consumer, modResource(castingFolder + "glass"));
// discount for casting panes
ItemCastingRecipeBuilder.tableRecipe(TinkerSmeltery.searedGlassPane).setFluidAndTime(TinkerFluids.searedStone, false, FluidValues.BRICK).setCast(Tags.Items.GLASS_PANES_COLORLESS, true).save(consumer, modResource(castingFolder + "glass_pane"));
// smeltery controller
ItemCastingRecipeBuilder.basinRecipe(TinkerSmeltery.smelteryController).setCast(TinkerSmeltery.searedHeater, true).setFluidAndTime(TinkerFluids.moltenCopper, true, FluidValues.INGOT * 4).save(consumer, prefix(TinkerSmeltery.smelteryController, castingFolder));
// craft seared stone from clay and stone
// button is the closest we have to a single stone brick, just go with it, better than not having the recipe
ItemCastingRecipeBuilder.tableRecipe(TinkerSmeltery.searedBrick).setFluidAndTime(TinkerFluids.moltenClay, false, FluidValues.BRICK / 2).setCast(Items.STONE_BUTTON, true).save(consumer, modResource(castingFolder + "brick_composite"));
// cobble
searedCasting(consumer, TinkerSmeltery.searedCobble, CompoundIngredient.from(Ingredient.of(Tags.Items.COBBLESTONE), Ingredient.of(Blocks.GRAVEL)), castingFolder + "cobble/block");
searedSlabCasting(consumer, TinkerSmeltery.searedCobble.getSlab(), Ingredient.of(Blocks.COBBLESTONE_SLAB), castingFolder + "cobble/slab");
searedCasting(consumer, TinkerSmeltery.searedCobble.getStairs(), Ingredient.of(Blocks.COBBLESTONE_STAIRS), castingFolder + "cobble/stairs");
searedCasting(consumer, TinkerSmeltery.searedCobble.getWall(), Ingredient.of(Blocks.COBBLESTONE_WALL), castingFolder + "cobble/wall");
// stone
searedCasting(consumer, TinkerSmeltery.searedStone, Ingredient.of(Tags.Items.STONE), castingFolder + "stone/block_from_clay");
searedSlabCasting(consumer, TinkerSmeltery.searedStone.getSlab(), Ingredient.of(Blocks.STONE_SLAB), castingFolder + "stone/slab");
searedCasting(consumer, TinkerSmeltery.searedStone.getStairs(), Ingredient.of(Blocks.STONE_STAIRS), castingFolder + "stone/stairs");
// stone bricks
searedCasting(consumer, TinkerSmeltery.searedBricks, Ingredient.of(Blocks.STONE_BRICKS), castingFolder + "bricks/block");
searedSlabCasting(consumer, TinkerSmeltery.searedBricks.getSlab(), Ingredient.of(Blocks.STONE_BRICK_SLAB), castingFolder + "bricks/slab");
searedCasting(consumer, TinkerSmeltery.searedBricks.getStairs(), Ingredient.of(Blocks.STONE_BRICK_STAIRS), castingFolder + "bricks/stairs");
searedCasting(consumer, TinkerSmeltery.searedBricks.getWall(), Ingredient.of(Blocks.STONE_BRICK_WALL), castingFolder + "bricks/wall");
// other seared
searedCasting(consumer, TinkerSmeltery.searedCrackedBricks, Ingredient.of(Blocks.CRACKED_STONE_BRICKS), castingFolder + "cracked");
searedCasting(consumer, TinkerSmeltery.searedFancyBricks, Ingredient.of(Blocks.CHISELED_STONE_BRICKS), castingFolder + "chiseled");
searedCasting(consumer, TinkerSmeltery.searedPaver, Ingredient.of(Blocks.SMOOTH_STONE), castingFolder + "paver");
// seared blocks
String meltingFolder = "smeltery/melting/seared/";
// double efficiency when using smeltery for grout
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.grout), TinkerFluids.searedStone.get(), FluidValues.BRICK * 2, 1.5f).save(consumer, modResource(meltingFolder + "grout"));
// seared stone
// stairs are here since the cheapest stair recipe is stone cutter, 1 to 1
MeltingRecipeBuilder.melting(CompoundIngredient.from(Ingredient.of(TinkerTags.Items.SEARED_BLOCKS), Ingredient.of(TinkerSmeltery.searedLadder, TinkerSmeltery.searedCobble.getWall(), TinkerSmeltery.searedBricks.getWall(), TinkerSmeltery.searedCobble.getStairs(), TinkerSmeltery.searedStone.getStairs(), TinkerSmeltery.searedBricks.getStairs(), TinkerSmeltery.searedPaver.getStairs())), TinkerFluids.searedStone.get(), FluidValues.BRICK_BLOCK, 2.0f).save(consumer, modResource(meltingFolder + "block"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedCobble.getSlab(), TinkerSmeltery.searedStone.getSlab(), TinkerSmeltery.searedBricks.getSlab(), TinkerSmeltery.searedPaver.getSlab()), TinkerFluids.searedStone.get(), FluidValues.BRICK_BLOCK / 2, 1.5f).save(consumer, modResource(meltingFolder + "slab"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedBrick), TinkerFluids.searedStone.get(), FluidValues.BRICK, 1.0f).save(consumer, modResource(meltingFolder + "brick"));
// melt down smeltery components
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedFaucet, TinkerSmeltery.searedChannel), TinkerFluids.searedStone.get(), FluidValues.BRICK, 1.5f).save(consumer, modResource(meltingFolder + "faucet"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedBasin, TinkerSmeltery.searedTable), TinkerFluids.searedStone.get(), FluidValues.BRICK * 7, 2.5f).save(consumer, modResource(meltingFolder + "casting"));
// tanks
MeltingRecipeBuilder.melting(NBTIngredient.from(new ItemStack(TinkerSmeltery.searedTank.get(TankType.FUEL_TANK))), TinkerFluids.searedStone.get(), FluidValues.BRICK * 8, 3f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_BLOCK)).save(consumer, modResource(meltingFolder + "fuel_tank"));
MeltingRecipeBuilder.melting(NBTIngredient.from(new ItemStack(TinkerSmeltery.searedTank.get(TankType.INGOT_TANK))), TinkerFluids.searedStone.get(), FluidValues.BRICK * 6, 2.5f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_BLOCK * 3)).save(consumer, modResource(meltingFolder + "ingot_tank"));
MeltingRecipeBuilder.melting(CompoundIngredient.from(NBTIngredient.from(new ItemStack(TinkerSmeltery.searedTank.get(TankType.FUEL_GAUGE))), NBTIngredient.from(new ItemStack(TinkerSmeltery.searedTank.get(TankType.INGOT_GAUGE)))), TinkerFluids.searedStone.get(), FluidValues.BRICK * 4, 2f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_BLOCK * 5)).save(consumer, modResource(meltingFolder + "gauge"));
MeltingRecipeBuilder.melting(NBTIngredient.from(new ItemStack(TinkerSmeltery.searedLantern)), TinkerFluids.searedStone.get(), FluidValues.BRICK * 2, 1.0f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_PANE)).addByproduct(new FluidStack(TinkerFluids.moltenIron.get(), FluidValues.INGOT / 3)).save(consumer, modResource(meltingFolder + "lantern"));
// glass
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedGlass), TinkerFluids.searedStone.get(), FluidValues.BRICK * 4, 2f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_BLOCK)).save(consumer, modResource(meltingFolder + "glass"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedGlassPane), TinkerFluids.searedStone.get(), FluidValues.BRICK, 1.0f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_PANE)).save(consumer, modResource(meltingFolder + "pane"));
// controllers
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedMelter), TinkerFluids.searedStone.get(), FluidValues.BRICK * 9, 3.5f).addByproduct(new FluidStack(TinkerFluids.moltenGlass.get(), FluidValues.GLASS_PANE * 5)).save(consumer, modResource(meltingFolder + "melter"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedHeater), TinkerFluids.searedStone.get(), FluidValues.BRICK * 8, 3f).save(consumer, modResource(meltingFolder + "heater"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.smelteryController), TinkerFluids.moltenCopper.get(), FluidValues.INGOT * 4, 3.5f).addByproduct(new FluidStack(TinkerFluids.searedStone.get(), FluidValues.BRICK * 8)).save(consumer, modResource("smeltery/melting/metal/copper/smeltery_controller"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedDrain, TinkerSmeltery.searedChute), TinkerFluids.moltenCopper.get(), FluidValues.INGOT * 2, 2.5f).addByproduct(new FluidStack(TinkerFluids.searedStone.get(), FluidValues.BRICK * 4)).save(consumer, modResource("smeltery/melting/metal/copper/smeltery_io"));
MeltingRecipeBuilder.melting(Ingredient.of(TinkerSmeltery.searedDuct), TinkerFluids.moltenCobalt.get(), FluidValues.INGOT * 2, 2.5f).addByproduct(new FluidStack(TinkerFluids.searedStone.get(), FluidValues.BRICK * 4)).save(consumer, modResource("smeltery/melting/metal/cobalt/seared_duct"));
// reinforcement - no seared stone as it can also be casted from scorched
MeltingRecipeBuilder.melting(Ingredient.of(TinkerModifiers.searedReinforcement), TinkerFluids.moltenObsidian.get(), FluidValues.GLASS_PANE).save(consumer, modResource(meltingFolder + "reinforcement"));
}
use of net.minecraft.data.recipes.FinishedRecipe in project TinkersConstruct by SlimeKnights.
the class ModifierRecipeProvider method addModifierRecipes.
private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
// upgrades
String upgradeFolder = "tools/modifiers/upgrade/";
String abilityFolder = "tools/modifiers/ability/";
String slotlessFolder = "tools/modifiers/slotless/";
String upgradeSalvage = "tools/modifiers/salvage/upgrade/";
String abilitySalvage = "tools/modifiers/salvage/ability/";
String slotlessSalvage = "tools/modifiers/salvage/slotless/";
String defenseFolder = "tools/modifiers/defense/";
String defenseSalvage = "tools/modifiers/salvage/defense/";
String compatFolder = "tools/modifiers/compat/";
String compatSalvage = "tools/modifiers/salvage/compat/";
/*
* durability
*/
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.reinforced.get()).setInputSalvage(TinkerModifiers.ironReinforcement, 1, 24, false).setMaxLevel(// max 75% resistant to damage
5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.DURABILITY).saveSalvage(consumer, prefix(TinkerModifiers.reinforced, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.reinforced, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.overforced.get()).setInputSalvage(TinkerModifiers.slimesteelReinforcement, 1, 24, false).setMaxLevel(// +250 capacity
5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.DURABILITY).saveSalvage(consumer, prefix(TinkerModifiers.overforced, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.overforced, upgradeFolder));
// gems are special, I'd like them to be useful on all types of tools
ModifierRecipeBuilder.modifier(TinkerModifiers.emerald.get()).addInput(Tags.Items.GEMS_EMERALD).addSalvage(Items.EMERALD, 0.5f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.emerald, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.emerald, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.diamond.get()).addInput(Tags.Items.GEMS_DIAMOND).addSalvage(Items.DIAMOND, 0.65f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.diamond, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.diamond, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.worldbound.get()).addInput(TinkerTags.Items.INGOTS_NETHERITE_SCRAP).addSalvage(Items.NETHERITE_SCRAP, 0.35f).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.worldbound, slotlessSalvage)).save(consumer, prefix(TinkerModifiers.worldbound, slotlessFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.soulbound.get()).addInputSalvage(Items.TOTEM_OF_UNDYING, 0.7f).setSlots(SlotType.UPGRADE, 1).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.soulbound, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.soulbound, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.netherite.get()).addInput(Tags.Items.INGOTS_NETHERITE).addSalvage(Items.NETHERITE_INGOT, 0.6f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).setRequirements(ModifierMatch.list(1, ModifierMatch.entry(TinkerModifiers.diamond.get()), ModifierMatch.entry(TinkerModifiers.emerald.get()))).setRequirementsError(makeRequirementsError("netherite_requirements")).saveSalvage(consumer, prefix(TinkerModifiers.netherite, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.netherite, upgradeFolder));
// overslime - earth
OverslimeModifierRecipeBuilder.modifier(TinkerCommons.slimeball.get(SlimeType.EARTH), 10).save(consumer, modResource(slotlessFolder + "overslime/earth_ball"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.congealedSlime.get(SlimeType.EARTH), 45).save(consumer, modResource(slotlessFolder + "overslime/earth_congealed"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.slime.get(SlimeType.EARTH), 108).save(consumer, modResource(slotlessFolder + "overslime/earth_block"));
// sky
OverslimeModifierRecipeBuilder.modifier(TinkerCommons.slimeball.get(SlimeType.SKY), 40).save(consumer, modResource(slotlessFolder + "overslime/sky_ball"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.congealedSlime.get(SlimeType.SKY), 180).save(consumer, modResource(slotlessFolder + "overslime/sky_congealed"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.slime.get(SlimeType.SKY), 432).save(consumer, modResource(slotlessFolder + "overslime/sky_block"));
// ichor
OverslimeModifierRecipeBuilder.modifier(TinkerCommons.slimeball.get(SlimeType.ICHOR), 100).save(consumer, modResource(slotlessFolder + "overslime/ichor_ball"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.congealedSlime.get(SlimeType.ICHOR), 450).save(consumer, modResource(slotlessFolder + "overslime/ichor_congealed"));
OverslimeModifierRecipeBuilder.modifier(TinkerWorld.slime.get(SlimeType.ICHOR), 1080).save(consumer, modResource(slotlessFolder + "overslime/ichor_block"));
/*
* general effects
*/
ModifierRecipeBuilder.modifier(TinkerModifiers.experienced.get()).addInput(Items.EXPERIENCE_BOTTLE).addInput(Items.EXPERIENCE_BOTTLE).addInput(Items.EXPERIENCE_BOTTLE).addSalvage(Items.EXPERIENCE_BOTTLE, 3).setMaxLevel(// max +250%
5).setSlots(SlotType.UPGRADE, 1).setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_HARVEST, TinkerTags.Items.LEGGINGS)).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.experienced, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.experienced, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.magnetic.get()).addInputSalvage(Items.COMPASS, 0.5f).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.MELEE_OR_HARVEST).save(consumer, prefix(TinkerModifiers.magnetic, upgradeFolder));
// armor has a max level of 1 per piece, so 4 total
ModifierRecipeBuilder.modifier(TinkerModifiers.magnetic.get()).addInputSalvage(Items.COMPASS, 0.5f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.ARMOR).save(consumer, wrap(TinkerModifiers.magnetic, upgradeFolder, "_armor"));
// salvage supports either
ModifierRecipeBuilder.modifier(TinkerModifiers.magnetic.get()).addSalvage(Items.COMPASS, 0.5f).setSlots(SlotType.UPGRADE, 1).setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_HARVEST, TinkerTags.Items.ARMOR)).saveSalvage(consumer, prefix(TinkerModifiers.magnetic, upgradeSalvage));
// no salvage so we can potentially grant shiny in another way without being an apple farm, and no recipe as that leaves nothing to salvage
ModifierRecipeBuilder.modifier(TinkerModifiers.shiny.get()).addInput(Items.ENCHANTED_GOLDEN_APPLE).setMaxLevel(1).save(consumer, prefix(TinkerModifiers.shiny, slotlessFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.farsighted.get()).setTools(TinkerTags.Items.MODIFIABLE).setInput(Tags.Items.CROPS_CARROT, 1, 45).save(consumer, prefix(TinkerModifiers.farsighted, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.nearsighted.get()).setTools(TinkerTags.Items.MODIFIABLE).setInput(Items.INK_SAC, 1, 45).save(consumer, prefix(TinkerModifiers.nearsighted, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.offhanded.get()).setTools(TinkerTags.Items.HELD).addInputSalvage(Items.LEATHER, 0.7f).addInputSalvage(Items.PHANTOM_MEMBRANE, 0.3f).addInput(SlimeType.ICHOR.getSlimeballTag()).setMaxLevel(1).setSalvageLevelRange(1, 1).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, wrap(TinkerModifiers.offhanded, upgradeSalvage, "_level_1")).save(consumer, wrap(TinkerModifiers.offhanded, upgradeFolder, "_level_1"));
ModifierRecipeBuilder.modifier(TinkerModifiers.offhanded.get()).setTools(TinkerTags.Items.HELD).addInputSalvage(Items.LEATHER, 0.7f).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInput(SlimeType.ICHOR.getSlimeballTag()).setMaxLevel(2).setMinSalvageLevel(2).setRequirements(ModifierMatch.entry(TinkerModifiers.offhanded.get(), 1)).setRequirementsError(makeRequirementsError("offhanded.level_2")).saveSalvage(consumer, wrap(TinkerModifiers.offhanded, upgradeSalvage, "_level_2")).save(consumer, wrap(TinkerModifiers.offhanded, upgradeFolder, "_level_2"));
/*
* Speed
*/
// haste can use redstone or blocks
Ingredient chestplateHarvest = ingredientFromTags(TinkerTags.Items.HARVEST, TinkerTags.Items.CHESTPLATES);
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.haste.get()).setTools(chestplateHarvest).setInput(Tags.Items.DUSTS_REDSTONE, 1, 45).setSalvage(Items.REDSTONE, false).setMaxLevel(// +25 mining speed, vanilla +26, +50% mining speed on chestplates
5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.haste, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.haste, upgradeFolder, "_from_dust"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.haste.get()).setTools(chestplateHarvest).setInput(Tags.Items.STORAGE_BLOCKS_REDSTONE, 9, 45).setLeftover(new ItemStack(Items.REDSTONE)).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.haste, upgradeFolder, "_from_block"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.blasting.get()).setTools(TinkerTags.Items.STONE_HARVEST).setInput(Tags.Items.GUNPOWDER, 1, 20).setSalvage(Items.GUNPOWDER, false).setMaxLevel(// +50 mining speed at max, conditionally
5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.blasting, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.blasting, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.hydraulic.get()).setTools(TinkerTags.Items.HARVEST).setInput(Tags.Items.DUSTS_PRISMARINE, 1, // stupid forge name
36).setSalvage(Items.PRISMARINE_SHARD, false).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.hydraulic, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.hydraulic, upgradeFolder, "_from_shard"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.hydraulic.get()).setTools(TinkerTags.Items.HARVEST).setInput(Blocks.PRISMARINE, 4, 36).setLeftover(new ItemStack(Items.PRISMARINE_SHARD)).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.hydraulic, upgradeFolder, "_from_block"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.hydraulic.get()).setTools(TinkerTags.Items.HARVEST).setInput(Blocks.PRISMARINE_BRICKS, 9, 36).setLeftover(new ItemStack(Items.PRISMARINE_SHARD)).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.hydraulic, upgradeFolder, "_from_bricks"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.lightspeed.get()).setTools(TinkerTags.Items.HARVEST).setInput(Tags.Items.DUSTS_GLOWSTONE, 1, 64).setSalvage(Items.GLOWSTONE_DUST, false).setMaxLevel(// +45 mining speed at max, conditionally
5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.lightspeed, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.lightspeed, upgradeFolder, "_from_dust"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.lightspeed.get()).setTools(TinkerTags.Items.HARVEST).setInput(Blocks.GLOWSTONE, 4, 64).setLeftover(new ItemStack(Items.GLOWSTONE_DUST)).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.lightspeed, upgradeFolder, "_from_block"));
/*
* weapon
*/
ModifierRecipeBuilder.modifier(TinkerModifiers.knockback.get()).addInputSalvage(Items.PISTON, 0.9f).addInput(TinkerTags.Items.SLIME_BLOCK).setMaxLevel(// max +2.5 knockback points (knockback 5) (whatever that number means in vanilla)
5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.MELEE).saveSalvage(consumer, prefix(TinkerModifiers.knockback, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.knockback, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.padded.get()).addInput(Items.LEATHER).addInput(ItemTags.WOOL).addInput(Items.LEATHER).addSalvage(Items.LEATHER, 2).setMaxLevel(// max 12.5% knockback, or 6.25% on the dagger
3).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.MELEE).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.padded, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.padded, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.severing.get()).addInput(TinkerTags.Items.WITHER_BONES).addInputSalvage(Items.LIGHTNING_ROD, 0.75f).addInput(TinkerTags.Items.WITHER_BONES).addInput(Items.TNT).addSalvage(TinkerMaterials.necroticBone, 2).setMaxLevel(// max +25% head drop chance, combine with +15% chance from luck
5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.MELEE).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.severing, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.severing, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.fiery.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Items.BLAZE_POWDER, 1, 25, false).setMaxLevel(// +25 seconds fire damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.fiery, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.fiery, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.necrotic.get()).addInputSalvage(Items.WITHER_ROSE, 0.1f).addInput(TinkerWorld.congealedSlime.get(SlimeType.BLOOD)).addInput(Items.GHAST_TEAR).setMaxLevel(// +50% chance of heal, combine with +40% from traits for +90% total
5).setSlots(SlotType.UPGRADE, 1).setTools(TinkerTags.Items.MELEE).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.necrotic, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.necrotic, upgradeFolder));
/*
* damage boost
*/
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.piercing.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Blocks.CACTUS, 1, 25, false).setMaxLevel(// +2.5 pierce damage
5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.piercing, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.piercing, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.smite.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Items.GLISTERING_MELON_SLICE, 1, 5, false).setMaxLevel(// +12.5 undead damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.smite, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.smite, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.baneOfSssss.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Items.FERMENTED_SPIDER_EYE, 1, 15, false).setMaxLevel(// +12.5 spider damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.baneOfSssss, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.baneOfSssss, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.antiaquatic.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Items.PUFFERFISH, 1, 20, false).setMaxLevel(// +12.5 fish damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.antiaquatic, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.antiaquatic, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.cooling.get()).setTools(TinkerTags.Items.MELEE).setInputSalvage(Items.PRISMARINE_CRYSTALS, 1, 25, false).setMaxLevel(// +10 fire mob damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.cooling, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.cooling, upgradeFolder));
// killager uses both types of lapis
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.killager.get()).setTools(TinkerTags.Items.MELEE).setInput(Tags.Items.GEMS_LAPIS, 1, 45).setSalvage(Items.LAPIS_LAZULI, 15, false).setMaxLevel(// +12.5 illager damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.killager, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.killager, upgradeFolder, "_from_dust"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.killager.get()).setTools(TinkerTags.Items.MELEE).setInput(Tags.Items.STORAGE_BLOCKS_LAPIS, 9, 45).setMaxLevel(// +12.5 illager damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().save(consumer, wrap(TinkerModifiers.killager, upgradeFolder, "_from_block"));
// sharpness can use shards or blocks
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.sharpness.get()).setTools(TinkerTags.Items.MELEE).setInput(Tags.Items.GEMS_QUARTZ, 1, 36).setSalvage(Items.QUARTZ, false).setMaxLevel(// +5 damage
5).setSlots(SlotType.UPGRADE, 1).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.sharpness, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.sharpness, upgradeFolder, "_from_shard"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.sharpness.get()).setTools(TinkerTags.Items.MELEE).setInput(Tags.Items.STORAGE_BLOCKS_QUARTZ, 4, 36).setLeftover(new ItemStack(Items.QUARTZ)).setMaxLevel(5).includeUnarmed().setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.sharpness, upgradeFolder, "_from_block"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.sweeping.get()).setTools(TinkerTags.Items.SWORD).setInputSalvage(Blocks.CHAIN, 1, 18, // every 9 is 11 ingots, so this is 22 ingots
true).setMaxLevel(// goes 25%, 50%, 75%, 100%
4).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.sweeping, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.sweeping, upgradeFolder));
// swiftstrike works on blocks too, we are nice
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.swiftstrike.get()).setTools(TinkerTags.Items.MELEE).setInput(Items.AMETHYST_SHARD, 1, 72).setSalvage(Items.AMETHYST_SHARD, false).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.swiftstrike, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.swiftstrike, upgradeFolder, "_from_shard"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.swiftstrike.get()).setTools(TinkerTags.Items.MELEE).setInput(Blocks.AMETHYST_BLOCK, 4, 72).setLeftover(new ItemStack(Items.AMETHYST_SHARD)).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.swiftstrike, upgradeFolder, "_from_block"));
/*
* armor
*/
// protection
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.meleeProtection.get()).setInputSalvage(TinkerModifiers.cobaltReinforcement, 1, 24, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.meleeProtection, defenseSalvage)).save(consumer, prefix(TinkerModifiers.meleeProtection, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.projectileProtection.get()).setInputSalvage(TinkerModifiers.bronzeReinforcement, 1, 24, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.projectileProtection, defenseSalvage)).save(consumer, prefix(TinkerModifiers.projectileProtection, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.blastProtection.get()).setInputSalvage(TinkerModifiers.emeraldReinforcement, 1, 24, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.blastProtection, defenseSalvage)).save(consumer, prefix(TinkerModifiers.blastProtection, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.magicProtection.get()).setInputSalvage(TinkerModifiers.goldReinforcement, 1, 24, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.magicProtection, defenseSalvage)).save(consumer, prefix(TinkerModifiers.magicProtection, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.fireProtection.get()).setInputSalvage(TinkerModifiers.searedReinforcement, 1, 24, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.fireProtection, defenseSalvage)).save(consumer, prefix(TinkerModifiers.fireProtection, defenseFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.protection.get()).addInputSalvage(TinkerModifiers.goldReinforcement, 1, 4).addInputSalvage(TinkerModifiers.searedReinforcement, 1, 4).addInputSalvage(TinkerModifiers.bronzeReinforcement, 1, 4).addInputSalvage(TinkerModifiers.emeraldReinforcement, 1, 4).addInputSalvage(TinkerModifiers.cobaltReinforcement, 1, 4).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.protection, abilitySalvage)).save(consumer, prefix(TinkerModifiers.protection, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.knockbackResistance.get()).setTools(TinkerTags.Items.ARMOR).addInput(SizedIngredient.fromItems(Blocks.ANVIL, Blocks.CHIPPED_ANVIL, Blocks.DAMAGED_ANVIL)).addSalvage(Blocks.DAMAGED_ANVIL, 0.5f).setSlots(SlotType.DEFENSE, 1).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.knockbackResistance, defenseSalvage)).save(consumer, prefix(TinkerModifiers.knockbackResistance, defenseFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.golden.get()).setTools(TinkerTags.Items.ARMOR).addInput(Tags.Items.INGOTS_GOLD).addInput(Tags.Items.INGOTS_GOLD).addInput(Tags.Items.INGOTS_GOLD).setSlots(SlotType.DEFENSE, 1).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.golden, defenseSalvage)).save(consumer, prefix(TinkerModifiers.golden, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.turtleShell.get()).setInputSalvage(Items.SCUTE, 1, 5, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.turtleShell, defenseSalvage)).save(consumer, prefix(TinkerModifiers.turtleShell, defenseFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.dragonborn.get()).setInputSalvage(TinkerModifiers.dragonScale, 1, 10, false).setSlots(SlotType.DEFENSE, 1).setTools(TinkerTags.Items.ARMOR).saveSalvage(consumer, prefix(TinkerModifiers.dragonScale, defenseSalvage)).save(consumer, prefix(TinkerModifiers.dragonScale, defenseFolder));
// 3 each for chest and legs, 2 each for boots and helmet, leads to 10 total
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.revitalizing.get()).setTools(ingredientFromTags(TinkerTags.Items.CHESTPLATES, TinkerTags.Items.LEGGINGS)).setInputSalvage(TinkerCommons.jeweledApple, 1, 2, false).setSlots(SlotType.DEFENSE, 1).setMaxLevel(3).save(consumer, wrap(TinkerModifiers.revitalizing, defenseFolder, "_large"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.revitalizing.get()).setTools(ingredientFromTags(TinkerTags.Items.HELMETS, TinkerTags.Items.BOOTS)).setInputSalvage(TinkerCommons.jeweledApple, 1, 2, false).setSlots(SlotType.DEFENSE, 1).setMaxLevel(2).save(consumer, wrap(TinkerModifiers.revitalizing, defenseFolder, "_small"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.revitalizing.get()).setTools(TinkerTags.Items.ARMOR).setInputSalvage(Items.GHAST_TEAR, 1, 5, false).setSlots(SlotType.DEFENSE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.revitalizing, defenseSalvage));
// upgrade - counterattack
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.thorns.get()).setTools(TinkerTags.Items.ARMOR).setInputSalvage(Blocks.CACTUS, 1, 25, false).setMaxLevel(3).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.thorns, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.thorns, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.sticky.get()).setTools(ingredientFromTags(TinkerTags.Items.MELEE, TinkerTags.Items.ARMOR)).setInputSalvage(Blocks.COBWEB, 1, 5, false).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.sticky, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.sticky, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.springy.get()).setTools(TinkerTags.Items.ARMOR).addInputSalvage(Items.PISTON, 0.9f).addInput(TinkerWorld.slime.get(SlimeType.ICHOR)).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.springy, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.springy, upgradeFolder));
// upgrade - helmet
ModifierRecipeBuilder.modifier(TinkerModifiers.respiration.get()).setTools(TinkerTags.Items.HELMETS).addInput(ItemTags.FISHES).addInput(Tags.Items.GLASS_COLORLESS).addInput(ItemTags.FISHES).addInputSalvage(Items.KELP, 0.5f).addInputSalvage(Items.KELP, 0.5f).setMaxLevel(3).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.respiration, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.respiration, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.itemFrame.get()).setTools(TinkerTags.Items.HELMETS).addInput(Ingredient.of(Arrays.stream(FrameType.values()).filter(type -> type != FrameType.CLEAR).map(type -> new ItemStack(TinkerGadgets.itemFrame.get(type))))).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.itemFrame, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.itemFrame, upgradeFolder));
// upgrade - chestplate
ModifierRecipeBuilder.modifier(TinkerModifiers.armorKnockback.get()).setTools(TinkerTags.Items.CHESTPLATES).addInputSalvage(Items.PISTON, 0.9f).addInput(TinkerWorld.slime.get(SlimeType.EARTH)).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.armorKnockback, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.armorKnockback, upgradeFolder));
// upgrade - leggings
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.speedy.get()).setTools(TinkerTags.Items.LEGGINGS).setInput(Tags.Items.DUSTS_REDSTONE, 1, 45).setSalvage(Items.REDSTONE, false).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.speedy, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.speedy, upgradeFolder, "_from_dust"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.speedy.get()).setTools(TinkerTags.Items.LEGGINGS).setInput(Tags.Items.STORAGE_BLOCKS_REDSTONE, 9, 45).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).save(consumer, wrap(TinkerModifiers.speedy, upgradeFolder, "_from_block"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.leaping.get()).setTools(TinkerTags.Items.LEGGINGS).setInputSalvage(Items.RABBIT_FOOT, 1, 5, false).setSlots(SlotType.UPGRADE, 1).setMaxLevel(2).saveSalvage(consumer, prefix(TinkerModifiers.leaping, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.leaping, upgradeFolder));
// half of pockets as a slotless
ModifierRecipeBuilder.modifier(TinkerModifiers.pocketChain.get()).setTools(TinkerTags.Items.LEGGINGS).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.3f).addInputSalvage(Items.CHAIN, 0.7f).addInputSalvage(Items.CHAIN, 0.4f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).setRequirementsError(makeRequirementsError("pocket_chain")).setRequirements(ModifierMatch.list(1, ModifierMatch.entry(TinkerModifiers.shieldStrap.get()), ModifierMatch.entry(TinkerModifiers.toolBelt.get()))).saveSalvage(consumer, prefix(TinkerModifiers.pocketChain, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.pocketChain, upgradeFolder));
// upgrade - boots
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.featherFalling.get()).setTools(TinkerTags.Items.BOOTS).setInputSalvage(Items.FEATHER, 1, 40, false).setSlots(SlotType.UPGRADE, 1).setMaxLevel(4).saveSalvage(consumer, prefix(TinkerModifiers.featherFalling, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.featherFalling, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.soulspeed.get()).setTools(TinkerTags.Items.BOOTS).addInputSalvage(Items.MAGMA_BLOCK, 0.2f).addInputSalvage(Items.CRYING_OBSIDIAN, 0.4f).addInputSalvage(Items.MAGMA_BLOCK, 0.2f).setSlots(SlotType.UPGRADE, 1).setMaxLevel(3).saveSalvage(consumer, prefix(TinkerModifiers.soulspeed, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.soulspeed, upgradeFolder));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.lightspeedArmor.get()).setTools(TinkerTags.Items.BOOTS).setInput(Tags.Items.DUSTS_GLOWSTONE, 1, 64).setSalvage(Items.GLOWSTONE_DUST, false).setMaxLevel(// 45% running speed at max, conditionally
3).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.lightspeedArmor, upgradeSalvage)).save(consumer, wrap(TinkerModifiers.lightspeedArmor, upgradeFolder, "_from_dust"));
IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.lightspeedArmor.get()).setTools(TinkerTags.Items.BOOTS).setInput(Blocks.GLOWSTONE, 4, 64).setLeftover(new ItemStack(Items.GLOWSTONE_DUST)).setMaxLevel(3).setSlots(SlotType.UPGRADE, 1).save(consumer, wrap(TinkerModifiers.lightspeedArmor, upgradeFolder, "_from_block"));
// upgrade - all
ModifierRecipeBuilder.modifier(TinkerModifiers.ricochet.get()).setTools(TinkerTags.Items.ARMOR).addInputSalvage(Items.PISTON, 0.9f).addInput(TinkerWorld.slime.get(SlimeType.SKY)).setSlots(SlotType.UPGRADE, 1).setMaxLevel(// 2 per piece gives +160% total
2).saveSalvage(consumer, prefix(TinkerModifiers.ricochet, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.ricochet, upgradeFolder));
// armor ability
// helmet
ModifierRecipeBuilder.modifier(TinkerModifiers.zoom.get()).setTools(TinkerTags.Items.HELMETS).addInput(Tags.Items.GLASS_PANES).addInput(Tags.Items.STORAGE_BLOCKS_REDSTONE).addInput(Tags.Items.GLASS_PANES).addInput(Tags.Items.INGOTS_COPPER).addInput(Tags.Items.INGOTS_COPPER).addSalvage(Items.REDSTONE, 0, 9).addSalvage(Items.GLASS_PANE, 0, 2).addSalvage(Items.COPPER_INGOT, 1, 2).setSlots(SlotType.ABILITY, 1).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.zoom, abilitySalvage)).save(consumer, prefix(TinkerModifiers.zoom, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.slurping.get()).addInputSalvage(Items.GLASS_BOTTLE, 0.5f).addInput(TinkerTags.Items.TANKS).addInputSalvage(Items.GLASS_BOTTLE, 0.5f).addInput(Tags.Items.INGOTS_COPPER).addInput(Tags.Items.INGOTS_COPPER).addSalvage(Items.COPPER_INGOT, 1, 2).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.HELMETS).saveSalvage(consumer, prefix(TinkerModifiers.slurping, abilitySalvage)).save(consumer, prefix(TinkerModifiers.slurping, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.aquaAffinity.get()).addInput(Blocks.PRISMARINE_BRICKS).addInputSalvage(Items.HEART_OF_THE_SEA, 0.65f).addInput(Blocks.PRISMARINE_BRICKS).addInput(Blocks.DARK_PRISMARINE).addInput(Blocks.DARK_PRISMARINE).addSalvage(Items.PRISMARINE_SHARD, 8, 34).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.HELMETS).saveSalvage(consumer, prefix(TinkerModifiers.aquaAffinity, abilitySalvage)).save(consumer, prefix(TinkerModifiers.aquaAffinity, abilityFolder));
// chestplate
ModifierRecipeBuilder.modifier(TinkerModifiers.unarmed.get()).setTools(TinkerTags.Items.CHESTPLATES).addInputSalvage(Items.LEATHER, 0.5f).addInput(Tags.Items.GEMS_DIAMOND).addInputSalvage(Items.LEATHER, 0.5f).addInput(Tags.Items.STRING).addInput(Tags.Items.STRING).addSalvage(Items.DIAMOND, 0.25f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.unarmed, abilitySalvage)).save(consumer, prefix(TinkerModifiers.unarmed, abilityFolder));
// if ichor geodes are disabled (sadface), use ichor dirt instead for the recipe
// if you are disabling both, you have a ton of recipes to fix anyways
IncrementalModifierRecipeBuilder geodeBuilder = IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.strength.get()).setTools(TinkerTags.Items.CHESTPLATES).setInputSalvage(TinkerWorld.ichorGeode.asItem(), 1, 72, false).setSlots(SlotType.ABILITY, 1);
IncrementalModifierRecipeBuilder noGeodeBuilder = IncrementalModifierRecipeBuilder.modifier(TinkerModifiers.strength.get()).setTools(TinkerTags.Items.CHESTPLATES).setInputSalvage(TinkerWorld.slimeDirt.get(SlimeType.ICHOR), 1, 36, false).setSlots(SlotType.ABILITY, 1);
ConditionalRecipe.builder().addCondition(ConfigEnabledCondition.ICHOR_GEODES).addRecipe(geodeBuilder::save).addCondition(TrueCondition.INSTANCE).addRecipe(noGeodeBuilder::save).build(consumer, prefix(TinkerModifiers.strength, abilityFolder));
// salvage needs to be a second recipe
ConditionalRecipe.builder().addCondition(ConfigEnabledCondition.ICHOR_GEODES).addRecipe(c -> geodeBuilder.saveSalvage(c, TinkerModifiers.strength.getId())).addCondition(TrueCondition.INSTANCE).addRecipe(c -> noGeodeBuilder.saveSalvage(c, TinkerModifiers.strength.getId())).build(consumer, prefix(TinkerModifiers.strength, abilitySalvage));
// leggings
ModifierRecipeBuilder.modifier(TinkerModifiers.pockets.get()).setTools(TinkerTags.Items.LEGGINGS).addInputSalvage(Items.SHULKER_SHELL, 0.9f).addInputSalvage(Tags.Items.INGOTS_IRON, 0.7f).addInputSalvage(Items.SHULKER_SHELL, 0.9f).addInputSalvage(Items.LEATHER, 0.4f).addInputSalvage(Items.LEATHER, 0.4f).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.pockets, abilitySalvage)).save(consumer, prefix(TinkerModifiers.pockets, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.shieldStrap.get()).addInputSalvage(TinkerWorld.skySlimeVine, 0.25f).addInputSalvage(TinkerMaterials.slimesteel.getIngotTag(), 0.7f).addInputSalvage(TinkerWorld.skySlimeVine, 0.25f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.LEGGINGS).saveSalvage(consumer, prefix(TinkerModifiers.shieldStrap, abilitySalvage)).save(consumer, prefix(TinkerModifiers.shieldStrap, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.toolBelt.get()).addInputSalvage(Items.LEATHER, 0.7f).addInputSalvage(TinkerMaterials.hepatizon.getIngotTag(), 0.7f).addInputSalvage(Items.LEATHER, 0.7f).addInputSalvage(Items.LEATHER, 0.4f).addInputSalvage(Items.LEATHER, 0.4f).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.LEGGINGS).saveSalvage(consumer, prefix(TinkerModifiers.toolBelt, abilitySalvage)).save(consumer, prefix(TinkerModifiers.toolBelt, abilityFolder));
// boots
ModifierRecipeBuilder.modifier(TinkerModifiers.doubleJump.get()).setTools(TinkerTags.Items.BOOTS).addInputSalvage(Items.PISTON, 0.9f).addInput(TinkerWorld.slime.get(SlimeType.SKY)).addInputSalvage(Items.PISTON, 0.9f).addInputSalvage(Items.PHANTOM_MEMBRANE, 0.3f).addInputSalvage(Items.PHANTOM_MEMBRANE, 0.3f).addSalvage(TinkerCommons.slimeball.get(SlimeType.SKY), 2, 9).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.doubleJump, abilitySalvage)).save(consumer, prefix(TinkerModifiers.doubleJump, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.bouncy.get()).setTools(IngredientDifference.difference(Ingredient.of(TinkerTags.Items.BOOTS), Ingredient.of(TinkerTools.slimesuit.get(ArmorSlotType.BOOTS)))).addInput(TinkerWorld.congealedSlime.get(SlimeType.SKY), 4).addInput(TinkerWorld.congealedSlime.get(SlimeType.ICHOR), 4).addInput(TinkerWorld.congealedSlime.get(SlimeType.SKY), 4).addInput(TinkerWorld.congealedSlime.get(SlimeType.EARTH), 4).addInput(TinkerWorld.congealedSlime.get(SlimeType.EARTH), 4).addSalvage(TinkerCommons.slimeball.get(SlimeType.EARTH), 4, 32).addSalvage(TinkerCommons.slimeball.get(SlimeType.SKY), 4, 32).addSalvage(TinkerCommons.slimeball.get(SlimeType.ICHOR), 4, 16).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.bouncy, abilitySalvage)).save(consumer, prefix(TinkerModifiers.bouncy, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.frostWalker.get()).setTools(TinkerTags.Items.BOOTS).addInput(Items.BLUE_ICE).addInputSalvage(TinkerWorld.heads.get(TinkerHeadType.STRAY), 0.5f).addInput(Items.BLUE_ICE).addInput(Items.BLUE_ICE).addInput(Items.BLUE_ICE).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.frostWalker, abilitySalvage)).save(consumer, prefix(TinkerModifiers.frostWalker, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.snowdrift.get()).setTools(TinkerTags.Items.BOOTS).addInput(Items.SNOW_BLOCK).addInput(Items.CARVED_PUMPKIN).addInput(Items.SNOW_BLOCK).addInput(Items.SNOW_BLOCK).addInput(Items.SNOW_BLOCK).addSalvage(Items.SNOWBALL, 0, 16).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.snowdrift, abilitySalvage)).save(consumer, prefix(TinkerModifiers.snowdrift, abilityFolder));
// transform ingredients
Ingredient bootsWithDuraibility = IngredientIntersection.intersection(Ingredient.of(TinkerTags.Items.BOOTS), Ingredient.of(TinkerTags.Items.DURABILITY));
SizedIngredient roundPlate = SizedIngredient.of(MaterialIngredient.fromItem(TinkerToolParts.roundPlate.get()));
SizedIngredient smallBlade = SizedIngredient.of(MaterialIngredient.fromItem(TinkerToolParts.smallBlade.get()));
SizedIngredient toolBinding = SizedIngredient.of(MaterialIngredient.fromItem(TinkerToolParts.toolBinding.get()));
ModifierRecipeBuilder.modifier(TinkerModifiers.pathMaker.get()).setTools(bootsWithDuraibility).addInput(roundPlate).addInput(TinkerTags.Items.INGOTS_NETHERITE_SCRAP).addInput(toolBinding).addInput(roundPlate).addInput(toolBinding).addSalvage(Items.NETHERITE_SCRAP, 0.35f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.pathMaker, abilitySalvage)).save(consumer, prefix(TinkerModifiers.pathMaker, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.plowing.get()).setTools(bootsWithDuraibility).addInput(smallBlade).addInput(TinkerTags.Items.INGOTS_NETHERITE_SCRAP).addInput(toolBinding).addInput(smallBlade).addInput(toolBinding).addSalvage(Items.NETHERITE_SCRAP, 0.35f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.plowing, abilitySalvage)).save(consumer, prefix(TinkerModifiers.plowing, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.flamewake.get()).setTools(bootsWithDuraibility).addInputSalvage(Items.FLINT, 0.2f).addInput(TinkerTags.Items.INGOTS_NETHERITE_SCRAP).addInputSalvage(Items.FLINT, 0.2f).addInputSalvage(Items.FLINT, 0.2f).addInputSalvage(Items.FLINT, 0.2f).addSalvage(Items.NETHERITE_SCRAP, 0.35f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.flamewake, abilitySalvage)).save(consumer, prefix(TinkerModifiers.flamewake, abilityFolder));
/*
* ability
*/
ModifierRecipeBuilder.modifier(TinkerModifiers.gilded.get()).addInput(Items.GOLDEN_APPLE).addSalvage(Items.APPLE, 0.75f).addSalvage(Items.GOLD_INGOT, 1, 8).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.gilded, abilitySalvage)).save(consumer, prefix(TinkerModifiers.gilded, abilityFolder));
// luck is 3 recipes, similar for both so pulled into a function
luckRecipes(consumer, TinkerModifiers.luck.get(), TinkerTags.Items.MELEE_OR_HARVEST, SlotType.ABILITY, false, abilityFolder, abilitySalvage);
luckRecipes(consumer, TinkerModifiers.looting.get(), TinkerTags.Items.CHESTPLATES, SlotType.UPGRADE, true, upgradeFolder, upgradeSalvage);
ModifierRecipeBuilder.modifier(TinkerModifiers.luck.get()).setTools(TinkerTags.Items.LEGGINGS).addInput(SizedIngredient.fromItems(Items.CORNFLOWER, Items.BLUE_ORCHID)).addInputSalvage(Items.RABBIT_FOOT, 0.15f).addInput(Items.GOLDEN_CARROT).addInput(Tags.Items.GEMS_DIAMOND).addInputSalvage(Items.NAME_TAG, 0.1f).addSalvage(Items.DIAMOND, 0.65f).addSalvage(Items.CARROT, // all the magic is gone, its just a carrot now
0.75f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, wrap(TinkerModifiers.luck, abilitySalvage, "_pants")).save(consumer, wrap(TinkerModifiers.luck, abilityFolder, "_pants"));
// silky: all the cloth
ModifierRecipeBuilder.modifier(TinkerModifiers.silky.get()).addInput(TinkerModifiers.silkyCloth).addInput(TinkerModifiers.silkyCloth).addInput(TinkerModifiers.silkyCloth).addInput(TinkerModifiers.silkyCloth).addInput(TinkerModifiers.silkyCloth).addSalvage(TinkerModifiers.silkyCloth, 3, 5).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.HARVEST).saveSalvage(consumer, prefix(TinkerModifiers.silky, abilitySalvage)).save(consumer, prefix(TinkerModifiers.silky, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.exchanging.get()).addInput(Items.STICKY_PISTON).addInputSalvage(TinkerMaterials.hepatizon.getIngotTag(), 1.0f).addInput(Items.STICKY_PISTON).addInput(Tags.Items.ENDER_PEARLS).addInput(Tags.Items.ENDER_PEARLS).addSalvage(Items.PISTON, // piston lost its sticky from all that swapping
0.9f).addSalvage(Items.PISTON, 0.9f).addSalvage(Items.ENDER_PEARL, 2).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.HARVEST).saveSalvage(consumer, prefix(TinkerModifiers.exchanging, abilitySalvage)).save(consumer, prefix(TinkerModifiers.exchanging, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.autosmelt.get()).addInput(Tags.Items.RAW_MATERIALS).addInputSalvage(Blocks.BLAST_FURNACE, 0.8f).addInput(Tags.Items.INGOTS).addInput(Tags.Items.STORAGE_BLOCKS_COAL).addInput(Tags.Items.STORAGE_BLOCKS_COAL).addSalvage(Items.COAL, 1, 18).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.HARVEST).saveSalvage(consumer, prefix(TinkerModifiers.autosmelt, abilitySalvage)).save(consumer, prefix(TinkerModifiers.autosmelt, abilityFolder));
// fluid stuff
ModifierRecipeBuilder.modifier(TinkerModifiers.melting.get()).addInput(Items.BLAZE_ROD).addInput(TinkerSmeltery.searedMelter).addInput(Items.BLAZE_ROD).addInput(Items.LAVA_BUCKET).addInput(Items.LAVA_BUCKET).addSalvage(TinkerSmeltery.searedBrick, 4, 9).addSalvage(Items.BLAZE_ROD, 2).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.MELEE_OR_HARVEST).includeUnarmed().saveSalvage(consumer, prefix(TinkerModifiers.melting, abilitySalvage)).save(consumer, prefix(TinkerModifiers.melting, abilityFolder));
// no salvage as don't want conversion between seared and scorched
SizedIngredient faucets = SizedIngredient.fromItems(TinkerSmeltery.searedFaucet, TinkerSmeltery.scorchedFaucet);
ModifierRecipeBuilder.modifier(TinkerModifiers.bucketing.get()).addInput(faucets).addInputSalvage(Items.BUCKET, 1.0f).addInput(faucets).addInput(Tags.Items.ENDER_PEARLS).addInput(Tags.Items.ENDER_PEARLS).addSalvage(Items.ENDER_PEARL, 2).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.INTERACTABLE).saveSalvage(consumer, prefix(TinkerModifiers.bucketing, abilitySalvage)).save(consumer, prefix(TinkerModifiers.bucketing, abilityFolder));
SizedIngredient channels = SizedIngredient.fromItems(TinkerSmeltery.searedChannel, TinkerSmeltery.scorchedChannel);
Ingredient meleeChestplate = ingredientFromTags(TinkerTags.Items.MELEE, TinkerTags.Items.CHESTPLATES);
ModifierRecipeBuilder.modifier(TinkerModifiers.spilling.get()).addInput(channels).addInput(TinkerTags.Items.TANKS).addInput(channels).addInput(Tags.Items.INGOTS_COPPER).addInput(Tags.Items.INGOTS_COPPER).addSalvage(Items.COPPER_INGOT, 1, 2).setSlots(SlotType.ABILITY, 1).setTools(meleeChestplate).saveSalvage(consumer, prefix(TinkerModifiers.spilling, abilitySalvage)).save(consumer, prefix(TinkerModifiers.spilling, abilityFolder));
// TODO: armor does not interact with chestplates for tanks, is that bad?
ModifierRecipeBuilder.modifier(TinkerModifiers.tank.get()).addInput(// no salvage as don't want conversion between seared and scorched
TinkerTags.Items.TANKS).setMaxLevel(5).setSlots(SlotType.UPGRADE, 1).setTools(ingredientFromTags(TinkerTags.Items.INTERACTABLE, TinkerTags.Items.HELMETS)).saveSalvage(consumer, prefix(TinkerModifiers.tank, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.tank, upgradeFolder));
// expanders
ModifierRecipeBuilder.modifier(TinkerModifiers.expanded.get()).addInputSalvage(Items.PISTON, 0.9f).addInputSalvage(TinkerMaterials.amethystBronze.getIngotTag(), 1.0f).addInputSalvage(Items.PISTON, 0.9f).addInput(SlimeType.ICHOR.getSlimeballTag()).addInput(SlimeType.ICHOR.getSlimeballTag()).setSlots(SlotType.ABILITY, 1).setTools(TinkerTags.Items.AOE).saveSalvage(consumer, prefix(TinkerModifiers.expanded, abilitySalvage)).save(consumer, prefix(TinkerModifiers.expanded, abilityFolder));
// reach expander
ModifierRecipeBuilder.modifier(TinkerModifiers.reach.get()).setTools(ingredientFromTags(TinkerTags.Items.HARVEST, TinkerTags.Items.CHESTPLATES)).addInputSalvage(Items.PISTON, 0.9f).addInputSalvage(TinkerMaterials.queensSlime.getIngotTag(), 1.0f).addInputSalvage(Items.PISTON, 0.9f).addInput(SlimeType.ENDER.getSlimeballTag()).addInput(SlimeType.ENDER.getSlimeballTag()).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.reach, abilitySalvage)).save(consumer, prefix(TinkerModifiers.reach, abilityFolder));
// block transformers
Ingredient heldWithDurability = IngredientIntersection.intersection(Ingredient.of(TinkerTags.Items.DURABILITY), Ingredient.of(TinkerTags.Items.INTERACTABLE));
ModifierRecipeBuilder.modifier(TinkerModifiers.pathing.get()).setTools(IngredientDifference.difference(heldWithDurability, Ingredient.of(TinkerTools.mattock, TinkerTools.excavator))).addInput(roundPlate).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInput(toolBinding).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.pathing, abilitySalvage)).save(consumer, prefix(TinkerModifiers.pathing, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.stripping.get()).setTools(IngredientDifference.difference(heldWithDurability, Ingredient.of(TinkerTools.handAxe, TinkerTools.broadAxe))).addInput(SizedIngredient.of(MaterialIngredient.fromItem(TinkerToolParts.smallAxeHead.get()))).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInput(toolBinding).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.stripping, abilitySalvage)).save(consumer, prefix(TinkerModifiers.stripping, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.tilling.get()).setTools(IngredientDifference.difference(heldWithDurability, Ingredient.of(TinkerTools.kama, TinkerTools.scythe))).addInput(smallBlade).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInput(toolBinding).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.tilling, abilitySalvage)).save(consumer, prefix(TinkerModifiers.tilling, abilityFolder));
// glowing
ModifierRecipeBuilder.modifier(TinkerModifiers.glowing.get()).setTools(heldWithDurability).addInput(Items.GLOWSTONE).addInputSalvage(Items.DAYLIGHT_DETECTOR, 0.9f).addInputSalvage(Items.SHROOMLIGHT, 0.4f).addSalvage(Items.GLOWSTONE_DUST, 1, 4).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.glowing, abilitySalvage)).save(consumer, prefix(TinkerModifiers.glowing, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.firestarter.get()).setTools(IngredientDifference.difference(heldWithDurability, Ingredient.of(TinkerTools.flintAndBrick))).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInputSalvage(Items.FLINT, 0.2f).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).saveSalvage(consumer, prefix(TinkerModifiers.firestarter, abilitySalvage)).save(consumer, prefix(TinkerModifiers.firestarter, abilityFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.fireprimer.get()).setTools(Ingredient.of(TinkerTools.flintAndBrick)).addInputSalvage(TinkerMaterials.cobalt.getIngotTag(), 0.35f).addInputSalvage(Items.FLINT, 0.2f).setMaxLevel(1).setSlots(SlotType.UPGRADE, 1).saveSalvage(consumer, prefix(TinkerModifiers.fireprimer, upgradeSalvage)).save(consumer, prefix(TinkerModifiers.fireprimer, upgradeFolder));
// unbreakable
ModifierRecipeBuilder.modifier(TinkerModifiers.unbreakable.get()).addInput(Items.SHULKER_SHELL).addInput(Items.DRAGON_BREATH).addInput(Items.SHULKER_SHELL).addInput(Tags.Items.INGOTS_NETHERITE).addInput(Tags.Items.INGOTS_NETHERITE).addSalvage(Items.NETHERITE_INGOT, 2, 2).addSalvage(Items.SHULKER_SHELL, 0, 2).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setRequirements(ModifierMatch.list(2, ModifierMatch.entry(TinkerModifiers.netherite.get(), 1), ModifierMatch.entry(TinkerModifiers.reinforced.get(), 5))).setRequirementsError(makeRequirementsError("unbreakable_requirements")).saveSalvage(consumer, prefix(TinkerModifiers.unbreakable, abilitySalvage)).save(consumer, prefix(TinkerModifiers.unbreakable, abilityFolder));
// weapon
ModifierRecipeBuilder.modifier(TinkerModifiers.dualWielding.get()).addInput(TinkerMaterials.manyullyn.getIngotTag()).addInput(Items.NAUTILUS_SHELL).addInput(TinkerMaterials.manyullyn.getIngotTag()).addInput(SlimeType.SKY.getSlimeballTag()).addInput(SlimeType.SKY.getSlimeballTag()).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(IngredientDifference.difference(IngredientIntersection.intersection(Ingredient.of(TinkerTags.Items.MELEE), Ingredient.of(TinkerTags.Items.ONE_HANDED)), Ingredient.of(TinkerTools.dagger))).save(consumer, wrap(TinkerModifiers.dualWielding, abilityFolder, "_one_handed"));
ModifierRecipeBuilder.modifier(TinkerModifiers.dualWielding.get()).addInput(TinkerMaterials.manyullyn.getIngotTag()).addInput(Items.NAUTILUS_SHELL).addInput(TinkerMaterials.manyullyn.getIngotTag()).addInput(SlimeType.SKY.getSlimeballTag()).addInput(SlimeType.SKY.getSlimeballTag()).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setRequirements(ModifierMatch.entry(TinkerModifiers.offhanded.get())).setRequirementsError(makeRequirementsError("two_handed_dual_wielding")).setTools(IngredientIntersection.intersection(Ingredient.of(TinkerTags.Items.MELEE), Ingredient.of(TinkerTags.Items.TWO_HANDED))).save(consumer, wrap(TinkerModifiers.dualWielding, abilityFolder, "_two_handed"));
// using a single salvage recipe for the two of them, as we don't care about requirements when removing
ModifierRecipeBuilder.modifier(TinkerModifiers.dualWielding.get()).addSalvage(Items.NAUTILUS_SHELL, 0.95f).addSalvage(TinkerMaterials.manyullyn.getIngotTag(), 2, 2).setMaxLevel(1).setSlots(SlotType.ABILITY, 1).setTools(IngredientDifference.difference(meleeChestplate, Ingredient.of(TinkerTools.dagger))).saveSalvage(consumer, prefix(TinkerModifiers.dualWielding, abilitySalvage));
/*
* extra modifiers
*/
ModifierRecipeBuilder.modifier(TinkerModifiers.writable.get()).addInputSalvage(Items.WRITABLE_BOOK, 1.0f).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.writable, slotlessSalvage)).save(consumer, prefix(TinkerModifiers.writable, slotlessFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.harmonious.get()).addInput(ItemTags.MUSIC_DISCS).addSalvage(Items.MUSIC_DISC_11, // your disc broke, now it sounds scary
1.0f).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.harmonious, slotlessSalvage)).save(consumer, prefix(TinkerModifiers.harmonious, slotlessFolder));
// you want your head back? that is gross!
ModifierRecipeBuilder.modifier(TinkerModifiers.recapitated.get()).addInput(SizedIngredient.of(IngredientDifference.difference(Ingredient.of(Tags.Items.HEADS), Ingredient.of(Items.DRAGON_HEAD)))).setMaxLevel(1).save(consumer, prefix(TinkerModifiers.recapitated, slotlessFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.resurrected.get()).addInput(Items.END_CRYSTAL).addSalvage(Items.ENDER_EYE, // ironic, it could save others, but it could not save itself
1.0f).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.resurrected, slotlessSalvage)).save(consumer, prefix(TinkerModifiers.resurrected, slotlessFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.draconic.get()).addInput(Items.DRAGON_HEAD).setMaxLevel(1).save(consumer, wrap(TinkerModifiers.draconic, slotlessFolder, "_from_head"));
ModifierRecipeBuilder.modifier(TinkerModifiers.draconic.get()).addInput(Items.SHULKER_SHELL).addInputSalvage(TinkerModifiers.dragonScale, // you can apply the modifier in two ways, but scales are cheap so give them
1.0f).addInput(Blocks.WITHER_ROSE).addInputSalvage(TinkerModifiers.dragonScale, 0.5f).addInputSalvage(TinkerModifiers.dragonScale, 0.25f).setMaxLevel(1).saveSalvage(consumer, prefix(TinkerModifiers.draconic, slotlessSalvage)).save(consumer, wrap(TinkerModifiers.draconic, slotlessFolder, "_from_scales"));
// creative
// no salvage. I am not adding a recipe for creative modifiers, nope. don't want the gift from the server admin to be abused as a upgrade source
SpecialRecipeBuilder.special(TinkerModifiers.creativeSlotSerializer.get()).save(consumer, modPrefix(slotlessFolder + "creative_slot"));
// removal
// temporary removal recipe until a proper table is added
ModifierRemovalRecipe.Builder.removal(Ingredient.of(Blocks.WET_SPONGE), new ItemStack(Blocks.SPONGE)).save(consumer, modResource(slotlessFolder + "remove_modifier"));
// compatability
String theOneProbe = "theoneprobe";
ResourceLocation probe = new ResourceLocation(theOneProbe, "probe");
Consumer<FinishedRecipe> topConsumer = withCondition(consumer, modLoaded(theOneProbe));
ModifierRecipeBuilder.modifier(TinkerModifiers.theOneProbe.get()).setTools(ingredientFromTags(TinkerTags.Items.HELMETS, TinkerTags.Items.HELD)).addInput(ItemNameIngredient.from(probe)).addSalvage(RandomItem.chance(ItemNameOutput.fromName(probe), 0.9f)).setSlots(SlotType.UPGRADE, 1).setMaxLevel(1).saveSalvage(topConsumer, prefix(TinkerModifiers.theOneProbe, compatSalvage)).save(topConsumer, prefix(TinkerModifiers.theOneProbe, compatFolder));
}
use of net.minecraft.data.recipes.FinishedRecipe in project Botania by VazkiiMods.
the class NbtOutputResult method with.
public static Consumer<FinishedRecipe> with(Consumer<FinishedRecipe> parent, Consumer<CompoundTag> tagSetup) {
CompoundTag tag = new CompoundTag();
tagSetup.accept(tag);
return recipe -> parent.accept(new NbtOutputResult(recipe, tag));
}
Aggregations