// Botania

import crafttweaker.api.item.IItemStack;
import mods.botania.RuneAltar;
import mods.botania.ElvenTrade;

// Petal Apothecary
// ---------------------------------------------------------------------------------------------------------------------------------------------
// Bush Base
craftingTable.removeRecipe(<item:metalbushesmod:bush_base>);
craftingTable.removeRecipe(<item:metalbushesmod:bush_wooden_base>);
craftingTable.removeRecipe(<item:metalbushesmod:nether_bush_base>);
<recipetype:botania:petal_apothecary>.addRecipe("botania_bush_base", 
    <item:metalbushesmod:bush_base>, <item:botania:green_petal>, <item:botania:green_petal>, 
    <item:botania:green_petal>, <item:botania:rune_greed>, <item:twilightforest:steeleaf_ingot>);

// Roots Dimension-Dependent Flowers
<recipetype:botania:petal_apothecary>.addRecipe("radiant_daisy", 
    <item:rootsclassic:radiant_daisy>, <tag:items:botania:petals/white>, <tag:items:botania:petals/white>, 
    <tag:items:botania:petals/white>, <tag:items:botania:petals/white>, <item:rootsclassic:mutating_powder>);
<recipetype:botania:petal_apothecary>.addRecipe("flare_orchid", 
    <item:rootsclassic:flare_orchid>, <tag:items:botania:petals/brown>, <tag:items:botania:petals/brown>, 
    <tag:items:botania:petals/red>, <tag:items:botania:petals/light_gray>, <item:rootsclassic:mutating_powder>);
<recipetype:botania:petal_apothecary>.addRecipe("midnight_bloom", 
    <item:rootsclassic:midnight_bloom>, <tag:items:botania:petals/light_blue>, <tag:items:botania:petals/green>, 
    <tag:items:botania:petals/red>, <tag:items:botania:petals/cyan>, <item:rootsclassic:mutating_powder>);

// Stonepetal
<recipetype:botania:petal_apothecary>.addRecipe("stonepetal", 
    <item:mysticalworld:stonepetal>, <tag:items:botania:petals/light_blue>, <tag:items:botania:petals/gray>, 
    <tag:items:botania:petals/light_gray>, <tag:items:botania:petals/light_gray>);

// Nature's Aura Flowers
<recipetype:botania:petal_apothecary>.addRecipe("oblivion_rose", 
    <item:naturesaura:end_flower>, <tag:items:botania:petals/blue>, <tag:items:botania:petals/blue>, 
    <tag:items:botania:petals/blue>, <tag:items:botania:petals/blue>, <item:botania:pixie_dust>);

<recipetype:botania:petal_apothecary>.addRecipe("aura_bloom", 
    <item:naturesaura:aura_bloom>, <tag:items:botania:petals/yellow>, <tag:items:botania:petals/lime>, 
    <tag:items:botania:petals/lime>, <tag:items:botania:petals/green>);

// Stuff I wanted to be in Roots
<recipetype:botania:petal_apothecary>.addRecipe("wither_rose", 
    <item:minecraft:wither_rose>, <item:twilightforest:thorn_rose>, <tag:items:botania:petals/black>, 
    <tag:items:botania:petals/black>, <tag:items:botania:petals/black>);

<recipetype:botania:petal_apothecary>.addRecipe("torchberries", 
    <item:twilightforest:torchberries>, <item:rootsclassic:nightshade>, <item:naturesaura:gold_powder>);

// Glowshroom
<recipetype:botania:petal_apothecary>.addRecipe("glowshroom", 
    <item:quark:glowshroom>, <item:botania:light_blue_mushroom>, <item:botania:cyan_mushroom>, 
    <item:botania:blue_mushroom>, <item:botania:mana_powder>);

// ---------------------------------------------------------------------------------------------------------------------------------------------


// Runic Altar
// ---------------------------------------------------------------------------------------------------------------------------------------------
// Coal Bush
craftingTable.removeRecipe(<item:metalbushesmod:coal_bush>);
<recipetype:botania:runic_altar>.addRecipe("botania_bush_coal", <item:metalbushesmod:coal_bush>, 125000, 
    <item:metalbushesmod:bush_base>, <item:minecraft:wither_rose>, <item:minecraft:wither_rose>, 
    <item:minecraft:wither_rose>, <item:minecraft:wither_rose>);

// Tin Bush
<recipetype:botania:runic_altar>.addRecipe("botania_bush_tin", <item:metalbushesmod:tin_bush>, 125000, 
    <item:metalbushesmod:bush_base>, <item:minecraft:lily_of_the_valley>, <item:minecraft:lily_of_the_valley>, 
    <item:minecraft:lily_of_the_valley>, <item:minecraft:lily_of_the_valley>);

// Rune of Nature
<recipetype:botania:runic_altar>.addRecipe("ending_living", <item:contenttweaker:ending_living>, 125000, 
    <item:rootsclassic:charged_runic_focus>, <item:botania:life_essence>, <item:naturesaura:generator_limit_remover>, 
    <item:botania:rune_wrath>, <item:botania:rune_greed>, <item:botania:rune_pride>, <item:botania:rune_sloth>);


// ---------------------------------------------------------------------------------------------------------------------------------------------


// Mana Infusion
// ---------------------------------------------------------------------------------------------------------------------------------------------
// Steeleaf Conjuration
<recipetype:botania:mana_infusion>.addRecipe("steeleaf_conjuration", <item:twilightforest:steeleaf_ingot> * 2, <item:twilightforest:steeleaf_ingot>, 5000, <block:botania:conjuration_catalyst>);

// Revitalize Rockroot more Efficiently
<recipetype:botania:mana_infusion>.addRecipe("rockroot_revitalization", <item:twilightforest:liveroot> * 12, <item:druidcraft:rockroot>, 5000, <block:botania:alchemy_catalyst>);

// Manasteel made with Ironwood is 50% cheaper
<recipetype:botania:mana_infusion>.addRecipe("ironwood_manasteel", <item:botania:manasteel_ingot>, <item:twilightforest:ironwood_ingot>, 1500);

// Transformation Powder from Mana Powder
<recipetype:botania:mana_infusion>.addRecipe("transformation_powder", <item:twilightforest:transformation_powder>, <item:botania:mana_powder>, 5000, <block:botania:alchemy_catalyst>);

// Seagrass to Kelp, and Back Again.
<recipetype:botania:mana_infusion>.addRecipe("seagrass_to_kelp", <item:minecraft:kelp>, <item:minecraft:seagrass>, 1500, <block:botania:alchemy_catalyst>);
<recipetype:botania:mana_infusion>.addRecipe("kelp_to_seagrass", <item:minecraft:seagrass>, <item:minecraft:kelp>, 1500, <block:botania:alchemy_catalyst>);

// ---------------------------------------------------------------------------------------------------------------------------------------------


// Elven Trade
// ---------------------------------------------------------------------------------------------------------------------------------------------
// Bottled Ender Air
<recipetype:botania:elven_trade>.addRecipe("ender_air", [<item:botania:ender_air_bottle>], <item:naturesaura:aura_bottle>.withTag({stored_type: "naturesaura:end" as string}));
// ---------------------------------------------------------------------------------------------------------------------------------------------


// Crafting
// ---------------------------------------------------------------------------------------------------------------------------------------------
// Terrasteel Armor uses Steeleaf to tie it into Twilight Forest progression.
// This got moved to datapacks.

// Botany Pots Reworked.
// I tried to use RegEx, and it didn't work :-(
craftingTable.removeByModid("botanypots");
craftingTable.addShaped("new_botany_pot", <item:botanypots:botany_pot>, [
    [<item:minecraft:air>, <item:botania:rune_winter>, <item:minecraft:air>],
    [<item:botania:rune_autumn>, <item:supplementaries:planter>, <item:botania:rune_spring>],
    [<item:minecraft:air>, <item:botania:rune_summer>, <item:minecraft:air>]]);

var hops = {
    <item:botanypots:hopper_botany_pot> : <item:botanypots:botany_pot>,
    <item:botanypots:hopper_white_botany_pot> : <item:botanypots:white_botany_pot>,
    <item:botanypots:hopper_orange_botany_pot> : <item:botanypots:orange_botany_pot>,
    <item:botanypots:hopper_magenta_botany_pot> : <item:botanypots:magenta_botany_pot>,
    <item:botanypots:hopper_light_blue_botany_pot> : <item:botanypots:light_blue_botany_pot>,
    <item:botanypots:hopper_yellow_botany_pot> : <item:botanypots:yellow_botany_pot>,
    <item:botanypots:hopper_lime_botany_pot> : <item:botanypots:lime_botany_pot>,
    <item:botanypots:hopper_pink_botany_pot> : <item:botanypots:pink_botany_pot>,
    <item:botanypots:hopper_gray_botany_pot> : <item:botanypots:gray_botany_pot>,
    <item:botanypots:hopper_light_gray_botany_pot> : <item:botanypots:light_gray_botany_pot>,
    <item:botanypots:hopper_cyan_botany_pot> : <item:botanypots:cyan_botany_pot>,
    <item:botanypots:hopper_purple_botany_pot> : <item:botanypots:purple_botany_pot>,
    <item:botanypots:hopper_blue_botany_pot> : <item:botanypots:blue_botany_pot>,
    <item:botanypots:hopper_brown_botany_pot> : <item:botanypots:brown_botany_pot>,
    <item:botanypots:hopper_green_botany_pot> : <item:botanypots:green_botany_pot>,
    <item:botanypots:hopper_red_botany_pot> : <item:botanypots:red_botany_pot>,
    <item:botanypots:hopper_black_botany_pot> : <item:botanypots:black_botany_pot>
} as IItemStack[IItemStack];

var count = 0;
for items in hops {
    craftingTable.addShapeless("botany_hoppification_" + count, items, [hops[items], <item:minecraft:hopper>]);
    count++;
}

var dyes = {
    <item:minecraft:white_dye> : <item:botanypots:white_botany_pot>,
    <item:minecraft:orange_dye> : <item:botanypots:orange_botany_pot>,
    <item:minecraft:magenta_dye> : <item:botanypots:magenta_botany_pot>,
    <item:minecraft:light_blue_dye> : <item:botanypots:light_blue_botany_pot>,
    <item:minecraft:yellow_dye> : <item:botanypots:yellow_botany_pot>,
    <item:minecraft:lime_dye> : <item:botanypots:lime_botany_pot>,
    <item:minecraft:pink_dye> : <item:botanypots:pink_botany_pot>,
    <item:minecraft:gray_dye> : <item:botanypots:gray_botany_pot>,
    <item:minecraft:light_gray_dye> : <item:botanypots:light_gray_botany_pot>,
    <item:minecraft:cyan_dye> : <item:botanypots:cyan_botany_pot>,
    <item:minecraft:purple_dye> : <item:botanypots:purple_botany_pot>,
    <item:minecraft:blue_dye> : <item:botanypots:blue_botany_pot>,
    <item:minecraft:brown_dye> : <item:botanypots:brown_botany_pot>,
    <item:minecraft:green_dye> : <item:botanypots:green_botany_pot>,
    <item:minecraft:red_dye> : <item:botanypots:red_botany_pot>,
    <item:minecraft:black_dye> : <item:botanypots:black_botany_pot>
} as IItemStack[IItemStack];

count = 1;
for items in dyes {
    craftingTable.addShapeless("botany_dyeification_" + count, dyes[items], [items, <item:botanypots:botany_pot>]);
    count++;
}

var dyehops = {
    <item:minecraft:white_dye> : <item:botanypots:hopper_white_botany_pot>,
    <item:minecraft:orange_dye> : <item:botanypots:hopper_orange_botany_pot>,
    <item:minecraft:magenta_dye> : <item:botanypots:hopper_magenta_botany_pot>,
    <item:minecraft:light_blue_dye> : <item:botanypots:hopper_light_blue_botany_pot>,
    <item:minecraft:yellow_dye> : <item:botanypots:hopper_yellow_botany_pot>,
    <item:minecraft:lime_dye> : <item:botanypots:hopper_lime_botany_pot>,
    <item:minecraft:pink_dye> : <item:botanypots:hopper_pink_botany_pot>,
    <item:minecraft:gray_dye> : <item:botanypots:hopper_gray_botany_pot>,
    <item:minecraft:light_gray_dye> : <item:botanypots:hopper_light_gray_botany_pot>,
    <item:minecraft:cyan_dye> : <item:botanypots:hopper_cyan_botany_pot>,
    <item:minecraft:purple_dye> : <item:botanypots:hopper_purple_botany_pot>,
    <item:minecraft:blue_dye> : <item:botanypots:hopper_blue_botany_pot>,
    <item:minecraft:brown_dye> : <item:botanypots:hopper_brown_botany_pot>,
    <item:minecraft:green_dye> : <item:botanypots:hopper_green_botany_pot>,
    <item:minecraft:red_dye> : <item:botanypots:hopper_red_botany_pot>,
    <item:minecraft:black_dye> : <item:botanypots:hopper_black_botany_pot>
} as IItemStack[IItemStack];

count = 1;
for items in dyehops {
    craftingTable.addShapeless("botany_hopper_dyeification_" + count, dyehops[items], [items, <item:botanypots:hopper_botany_pot>]);
    count++;
}

// Other Natures's Aura Plants
craftingTable.addShapeless("aura_mushroom_crafting", <item:naturesaura:aura_mushroom>, [<item:minecraft:red_mushroom>, <item:naturesaura:aura_bloom>]);

craftingTable.addShapeless("aura_cactus_crafting", <item:naturesaura:aura_cactus>, [<item:minecraft:cactus>, <item:naturesaura:aura_bloom>]);

craftingTable.addShapeless("aura_warped_crafting", <item:naturesaura:warped_aura_mushroom>, [<item:minecraft:warped_fungus>, <item:naturesaura:aura_bloom>]);

craftingTable.addShapeless("aura_crimson_crafting", <item:naturesaura:crimson_aura_mushroom>, [<item:minecraft:crimson_fungus>, <item:naturesaura:aura_bloom>]);

// Cursed Earth
craftingTable.addShaped("cursed_earth", <item:cursedearth:cursed_earth>, [
    [<item:botania:dry_seeds>, <item:botania:life_essence>, <item:botania:scorched_seeds>],
    [<item:botania:golden_seeds>, <item:minecraft:dirt>, <item:botania:infused_seeds>],
    [<item:botania:vivid_seeds>, <item:naturesaura:aura_bottle>.withTag({stored_type: "naturesaura:end" as string}), <item:botania:mutated_seeds>]]);

// ---------------------------------------------------------------------------------------------------------------------------------------------



/*
<recipetype:botania:runic_altar>.addRecipe("botania_bush_base", <item:metalbushesmod:bush_base>, 125000, 
[<item:botania:green_petal>, <item:botania:green_petal>, <item:botania:green_petal>, 
<item:botania:rune_greed>, <item:botania:overgrowth_seed>, <item:twilightforest:steeleaf_ingot>]);
*/


// https://github.com/VazkiiMods/Botania/blob/master/src/main/java/vazkii/botania/common/integration/crafttweaker/PetalApothecaryRecipeManager.java





// <recipetype:botania:petal_apothecary>
// <recipetype:botania:runic_altar>