import mods.thaumcraft.Arcane;
import mods.thaumcraft.Research;
import mods.thaumcraft.Crucible;
import mods.thaumcraft.Infusion;
import mods.avaritia.ExtremeCrafting;
import minetweaker.item.IItemStack;

val Chromastone = <ChromatiCraft:chromaticraft_item_crafting:21>;
val IridescentCrystalChunk = <ChromatiCraft:chromaticraft_item_crafting:10>;
val KamiCap = <ThaumicTinkerer:kamiResource:4>;
val CrystalWand = <ChromatiCraft:chromaticraft_item_modinteract>;
val ComplexCap = <ChromatiCraft:chromaticraft_item_modinteract:4>;
val VoidMetalIngot = <Thaumcraft:ItemResource:16>;
val KamiWandCore = <ThaumicTinkerer:kamiResource:5>;
val BalancedShard = <Thaumcraft:ItemShard:6>;
val VisFilter = <Thaumcraft:ItemResource:8>;
val CreationShard = <TaintedMagic:ItemMaterial:5>;
val Ichor = <ThaumicTinkerer:kamiResource>;
val Terrae = <AWWayofTime:terrae>;
val Incendium = <AWWayofTime:incendium>;
val Aquasalus = <AWWayofTime:aquasalus>;
val Aether = <AWWayofTime:aether>;
val PrimordialPearl = <Thaumcraft:ItemEldritchObject:3>;
val NeutroniumBlock = <ore:blockCosmicNeutronium>;
val ShadowMetalBlock = <ore:blockShadow>;
val Beacon = <minecraft:beacon>;
val NetherStar = <minecraft:nether_star>;
val GaiaSpirit = <Botania:manaResource:5>;
val ShieldingGlass = <ChromatiCraft:chromaticraft_block_structshield:5>;
val Obsidian = <minecraft:obsidian>;
val GuiltyPool = <Botania:pool:1>;
val TerraSteelLargePlate = <ExtraTiC:largeplate:146>;
val EssentiaReservoir = <Thaumcraft:blockEssentiaReservoir>;
val ManaBooster = <ChromatiCraft:chromaticraft_item_placer:95>;
val InfinityCatalyst = <Avaritia:Resource:5>;
val FabulousPool = <Botania:pool:3>;
val ShimmerRock = <Botania:shimmerrock>;
val CapacityUpgradeMax = <ChromatiCraft:chromaticraft_item_adjacency:6>.withTag({tier: 7});
val EnergizedVoidCore = <ChromatiCraft:chromaticraft_item_crafting:23>;
val CrystalTank = <ChromatiCraft:chromaticraft_block_tank>;
val DraconicToolsAndArmor = [<DraconicEvolution:draconicPickaxe>,<DraconicEvolution:draconicSword>,<DraconicEvolution:draconicShovel>,<DraconicEvolution:draconicAxe>,<DraconicEvolution:draconicBow>,<DraconicEvolution:draconicHelm>,<DraconicEvolution:draconicChest>,<DraconicEvolution:draconicLeggs>,<DraconicEvolution:draconicBoots>] as IItemStack[];
val InfinityToolsAndArmor = [<Avaritia:Infinity_Pickaxe>.withTag({ench: [{lvl: 10 as short, id: 35 as short}]}),<Avaritia:Infinity_Sword>,<Avaritia:Infinity_Shovel>,<Avaritia:Infinity_Axe>,<Avaritia:Infinity_Bow>,<Avaritia:Infinity_Helm>,<Avaritia:Infinity_Chest>,<Avaritia:Infinity_Pants>,<Avaritia:Infinity_Shoes>] as IItemStack[];
val InfinityIngot = <Avaritia:Resource:6>;
val NeutroniumIngot = <Avaritia:Resource:4>;
val ChaosBlendedIchor = <customthings:item:1>;
val PixieDust = <Botania:manaResource:8>;
val CreationShardRecipe = [Ichor,<ChromatiCraft:chromaticraft_item_shard:16>,<ChromatiCraft:chromaticraft_item_shard:17>,<ChromatiCraft:chromaticraft_item_shard:18>,<ChromatiCraft:chromaticraft_item_shard:19>,Incendium,Ichor,<ChromatiCraft:chromaticraft_item_shard:20>,<ChromatiCraft:chromaticraft_item_shard:21>,<ChromatiCraft:chromaticraft_item_shard:22>,<ChromatiCraft:chromaticraft_item_shard:23>,Aquasalus,Ichor,<ChromatiCraft:chromaticraft_item_shard:24>,<ChromatiCraft:chromaticraft_item_shard:25>,<ChromatiCraft:chromaticraft_item_shard:26>,<ChromatiCraft:chromaticraft_item_shard:27>,Aether,Ichor,<ChromatiCraft:chromaticraft_item_shard:28>,<ChromatiCraft:chromaticraft_item_shard:29>,<ChromatiCraft:chromaticraft_item_shard:30>,<ChromatiCraft:chromaticraft_item_shard:31>,Terrae] as IItemStack[];
val CreativeNode = <Thaumcraft:BlockJarNodeItem>.withTag({nodetype: 0, Aspects: [{amount: 10000, key: "aer"},{amount: 10000, key: "terra"},{amount: 10000, key: "aqua"},{amount: 10000, key: "ignis"},{amount: 10000, key: "ordo"},{amount: 10000, key: "perditio"}], nodemod: 0});
val NodeInAJar = <Thaumcraft:BlockJarNodeItem>;
val AeonSteel = <customthings:item>;
val CreativeNode2 = <customthings:item:2>;
val ShimmerWoodSlab = <Botania:shimmerwoodPlanks0Slab>;
val WardedGlass = <Thaumcraft:blockCosmeticOpaque:2>;
val MixedCrystalBlock = <thaumicbases:crystalBlock:6>;
val AquaDust = <ChromatiCraft:chromaticraft_item_dimgen:2>;
val WaterEssence = <arsmagica2:essence:4>;
val InfinityJar = <Automagy:blockCreativeJar:3>;
val VoidMetalLargePlate = <ExtraTiC:largeplate:172>;
val AspectJar = <ChromatiCraft:chromaticraft_item_placer:32>;
val EnergyBoosterMax = <ChromatiCraft:chromaticraft_item_adjacency:11>.withTag({tier: 7});
val NeutroniumNugget = <Avaritia:Resource:3>;
val InfinityWand = <Thaumcraft:WandCasting:9000>.withTag({aqua: 999999900, terra: 999999900, ignis: 999999900, cap: "matrix", rod: "infinity", ordo: 999999900, perditio: 999999900, aer: 999999900});
val ArmokOrb = <Avaritia:Orb_Armok>;
val TestingOrb = <AWWayofTime:creativeFiller>;
val CrystalCluster = <AWWayofTime:blockCrystal>;
val DemonicBlood = <witchery:ingredient:80>;
val T5BloodTank = <Sanguimancy:BlockBloodTank:4>;
val EldritchOrb = <ForbiddenMagic:EldritchOrb>;
val SuperiorCapacityRune = <AWWayofTime:AlchemicalWizardrybloodRune:4>;
val BloodRod = <ForbiddenMagic:WandCores:3>;
val RitualStone = <AWWayofTime:ritualStone>;
val HealingCoreMax = <ChromatiCraft:chromaticraft_item_adjacency:13>.withTag({tier: 7});
val FilledSocket = <AWWayofTime:bloodSocket>;
val AwakenedRitualCrystal = <AWWayofTime:activationCrystal:1>;
val InfinityLargePlate = <TConstruct:heavyPlate:501>;
val StorageComponent16K = <appliedenergistics2:item.ItemMultiMaterial:37>;
val BedrockiumBlock = <ExtraUtilities:block_bedrockium>;
val EmeraldStorageUpgrade = <StorageDrawers:upgrade:6>;
val YOUWIN = <StorageDrawers:upgradeCreative:1>;
val CreativeAuraPump = <aura:auraNodepumpCreative>;
val GreenGem = <aura:gemGreen>;
val AngelSteel1 = <aura:ingotAngelSteel>;
val BlackGem = <aura:gemBlack>;
val MultiAuraRepeater = <ChromatiCraft:chromaticraft_item_placer:30>;
val AuraManipulatorBlack = <aura:auraNodeblack>;
val AuraManipulatorOrange = <aura:auraNodeorange>;
val RangeExpander = <ChromatiCraft:chromaticraft_item_adjacency:10>.withTag({tier: 7});
val ArcanePrism = <aura:prismWhite>;
val AuraConductingIngot = <ChromatiCraft:chromaticraft_item_crafting:20>;
val PortableRedHole = <aura:redHole>;
val AlternatingRedstonePump = <aura:auraNodepumpRedstoneAlt>;
val AlternatingIlluminationPump = <aura:auraNodepumpLightAlt>;
val AlternatingBurningPump = <aura:auraNodepumpAlt>;

mods.thaumcraft.Aspects.add(<ChromatiCraft:chromaticraft_item_dimgen:*>, "terminus 4");
mods.thaumcraft.Aspects.add(<AWWayofTime:blockCrystal>, "terminus 4");

Arcane.removeRecipe(ComplexCap);
Arcane.addShaped("tieredorecap",ComplexCap,"ordo 500, perditio 500, aqua 500, aer 500, ignis 500, terra 500",[[Chromastone,Chromastone,Chromastone],[Chromastone,KamiCap,Chromastone]]);
Research.refreshResearchRecipe("tieredorecap");

Infusion.removeRecipe(CrystalWand);
Infusion.addRecipe("ROD_CRYSTALWAND",KamiWandCore,[Chromastone,IridescentCrystalChunk,VoidMetalIngot,BalancedShard,VisFilter,Chromastone,IridescentCrystalChunk,VoidMetalIngot,BalancedShard,VisFilter],"signum 360, potentia 200, vitreus 200, auram 120, praecantatio 80, permutatio 50, ordo 40",CrystalWand,18);
Research.refreshResearchRecipe("ROD_CRYSTALWAND");

recipes.remove(<TConstruct:ToolForgeBlock:*>);
recipes.remove(<TConstruct:CraftingSlab:*>);

Infusion.removeRecipe(CreationShard);
Infusion.addRecipe("CREATIONSHARD",PrimordialPearl,CreationShardRecipe,"praecantatio 64, ignis 48, aqua 48, terra 48, aer 48, ordo 48, perditio 48, vitreus 48, auram 32, vacuos 24", CreationShard, 15);
Research.refreshResearchRecipe("CREATIONSHARD");

recipes.remove(Beacon);
recipes.addShaped(Beacon,[[ShieldingGlass,PixieDust,ShieldingGlass],[ShieldingGlass,NetherStar,ShieldingGlass],[Obsidian,Obsidian,Obsidian]]);

ExtremeCrafting.addShaped(GuiltyPool,[
[ShimmerRock,null,null,null,null,null,null,null,ShimmerRock],
[ShimmerRock,CrystalTank,ManaBooster,EssentiaReservoir,TerraSteelLargePlate,EssentiaReservoir,ManaBooster,CrystalTank,ShimmerRock],
[ShimmerRock,FabulousPool,InfinityCatalyst,CapacityUpgradeMax,EnergizedVoidCore,CapacityUpgradeMax,InfinityCatalyst,FabulousPool,ShimmerRock],
[ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock,ShimmerRock],
]);

Research.addResearch("INFINITYTOOLS", "TM", "perditio 10, ordo 10, permutatio 10, potentia 10, praecantio 10, terminus 10", 14, -10, 100, InfinityIngot);
Research.addPage("INFINITYTOOLS", "INFINITYTOOLS.research_page.1");
game.setLocalization("en_US", "INFINITYTOOLS.research_page.1", "You have found something to use the infinity catalyst for. The ultimate set of armor and tools. It will make you as close to a god as you could possibly be.");
game.setLocalization("en_US", "tc.research_name.INFINITYTOOLS", "Infinity Tools");
game.setLocalization("en_US", "tc.research_text.INFINITYTOOLS", 'The beyond in "To infinity and beyond".');
Research.addPrereq("INFINITYTOOLS","INFINITY");

for i,InfinityItem in InfinityToolsAndArmor {
    ExtremeCrafting.remove(InfinityItem);
    Infusion.addRecipe("INFINITYTOOLS",DraconicToolsAndArmor[i],[InfinityIngot,NeutroniumIngot,ChaosBlendedIchor,NeutroniumIngot,InfinityCatalyst,NeutroniumIngot],"terminus 64",InfinityItem,15);
    Research.addInfusionPage("INFINITYTOOLS",InfinityItem);
}

Research.addResearch("CREATIVENODE", "TM", "perditio 10, ordo 10, permutatio 10, potentia 10, praecantio 10, terminus 10", 14, -8, 100, <Thaumcraft:blockAiry>);
Research.addPage("CREATIVENODE", "CREATIVENODE.research_page.1");
game.setLocalization("en_US", "CREATIVENODE.research_page.1", "The Infinity Catalyst seems to interact with nodes quite strangely, somehow making their capacity for Vis near infinite. The problem is that the nodes also tend to explode violently if you aren't careful with them. After long planning, you have finally found a way to safely combine the two. You call the result The Creative Node. <BR>Strangely enough, the recipe does not even seem unstable in the slightest. Maybe the Aeon Steel somehow stabilizes it?");
game.setLocalization("en_US", "tc.research_name.CREATIVENODE", "Infinity Node");
game.setLocalization("en_US", "tc.research_text.CREATIVENODE", 'Infinite Power!');
Research.addPrereq("CREATIVENODE","INFINITY");
Infusion.addRecipe("CREATIVENODE",NodeInAJar,[InfinityCatalyst,NeutroniumIngot,AeonSteel,NeutroniumIngot,AeonSteel,NeutroniumIngot,AeonSteel,NeutroniumIngot,AeonSteel,NeutroniumIngot],"ordo 512, perditio 512, terra 512, ignis 512, aer 512, aqua 512",CreativeNode2,0);
Research.addInfusionPage("CREATIVENODE",CreativeNode2);
recipes.addShapeless(CreativeNode,[CreativeNode2]);

ExtremeCrafting.addShaped(InfinityJar,[
[null,ShimmerWoodSlab,ShimmerWoodSlab,ShimmerWoodSlab,ShimmerWoodSlab,ShimmerWoodSlab,ShimmerWoodSlab,ShimmerWoodSlab,null],
[null,WardedGlass,CapacityUpgradeMax,MixedCrystalBlock,AquaDust,MixedCrystalBlock,CapacityUpgradeMax,WardedGlass,null],
[null,WardedGlass,VoidMetalLargePlate,AquaDust,MixedCrystalBlock,AquaDust,VoidMetalLargePlate,WardedGlass,null],
[null,WardedGlass,WaterEssence,EssentiaReservoir,AspectJar,EssentiaReservoir,WaterEssence,WardedGlass,null],
[null,WardedGlass,WaterEssence,AspectJar,InfinityCatalyst,AspectJar,WaterEssence,WardedGlass,null],
[null,WardedGlass,WaterEssence,EssentiaReservoir,AspectJar,EssentiaReservoir,WaterEssence,WardedGlass,null],
[null,WardedGlass,VoidMetalLargePlate,AquaDust,PrimordialPearl,AquaDust,VoidMetalLargePlate,WardedGlass,null],
[null,WardedGlass,CapacityUpgradeMax,MixedCrystalBlock,ChaosBlendedIchor,MixedCrystalBlock,CapacityUpgradeMax,WardedGlass,null],
[null,WardedGlass,WardedGlass,WardedGlass,WardedGlass,WardedGlass,WardedGlass,WardedGlass,null]]);

ExtremeCrafting.remove(InfinityWand);
ExtremeCrafting.addShaped(InfinityWand,[
[null,null,null,null,null,null,NeutroniumNugget,null,null],
[null,null,null,null,null,NeutroniumNugget,EnergyBoosterMax,NeutroniumNugget,null],
[null,null,null,null,null,NeutroniumNugget,InfinityCatalyst,EnergyBoosterMax,NeutroniumNugget],
[null,null,null,null,NeutroniumIngot,AeonSteel,NeutroniumNugget,NeutroniumNugget,null],
[null,null,null,NeutroniumIngot,CrystalWand,NeutroniumIngot,null,null,null],
[null,NeutroniumNugget,NeutroniumNugget,AeonSteel,NeutroniumIngot,null,null,null,null],
[NeutroniumNugget,EnergyBoosterMax,InfinityCatalyst,NeutroniumNugget,null,null,null,null,null],
[null,NeutroniumNugget,EnergyBoosterMax,NeutroniumNugget,null,null,null,null,null],
[null,null,NeutroniumNugget,null,null,null,null,null,null]]);

ExtremeCrafting.remove(ArmokOrb);
ExtremeCrafting.addShaped(TestingOrb,[
[null,null,null,CrystalCluster,CrystalCluster,CrystalCluster,null,null,null],
[null,null,CrystalCluster,DemonicBlood,T5BloodTank,DemonicBlood,CrystalCluster,null,null],
[null,null,CrystalCluster,T5BloodTank,EldritchOrb,T5BloodTank,CrystalCluster,null,null],
[null,SuperiorCapacityRune,CrystalCluster,DemonicBlood,T5BloodTank,DemonicBlood,CrystalCluster,SuperiorCapacityRune,null],
[RitualStone,FilledSocket,SuperiorCapacityRune,BloodRod,InfinityCatalyst,BloodRod,SuperiorCapacityRune,FilledSocket,RitualStone],
[RitualStone,RitualStone,FilledSocket,HealingCoreMax,AwakenedRitualCrystal,HealingCoreMax,FilledSocket,RitualStone,RitualStone],
[null,RitualStone,RitualStone,RitualStone,RitualStone,RitualStone,RitualStone,RitualStone,null],
[null,null,null,RitualStone,RitualStone,RitualStone,null,null,null]]);

InfinityJar.addTooltip(format.red("Warning, can not be picked up once placed!"));

ExtremeCrafting.addShaped(YOUWIN*2,[
[NeutroniumBlock,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumBlock],
[NeutroniumIngot,EmeraldStorageUpgrade,AeonSteel,StorageComponent16K,InfinityIngot,StorageComponent16K,AeonSteel,EmeraldStorageUpgrade,NeutroniumIngot],
[NeutroniumIngot,AeonSteel,InfinityIngot,NeutroniumIngot,NeutroniumBlock,NeutroniumIngot,InfinityIngot,AeonSteel,NeutroniumIngot],
[NeutroniumIngot,StorageComponent16K,NeutroniumIngot,BedrockiumBlock,TestingOrb,BedrockiumBlock,NeutroniumIngot,StorageComponent16K,NeutroniumIngot],
[NeutroniumIngot,InfinityIngot,NeutroniumBlock,GuiltyPool,<customthings:item:3>,InfinityWand,NeutroniumBlock,InfinityIngot,NeutroniumIngot],
[NeutroniumIngot,StorageComponent16K,NeutroniumIngot,BedrockiumBlock,InfinityJar,BedrockiumBlock,NeutroniumIngot,StorageComponent16K,NeutroniumIngot],
[NeutroniumIngot,AeonSteel,InfinityIngot,NeutroniumIngot,NeutroniumBlock,NeutroniumIngot,InfinityIngot,AeonSteel,NeutroniumIngot],
[NeutroniumIngot,EmeraldStorageUpgrade,AeonSteel,StorageComponent16K,InfinityIngot,StorageComponent16K,AeonSteel,EmeraldStorageUpgrade,NeutroniumIngot],
[NeutroniumBlock,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumIngot,NeutroniumBlock]]);

ExtremeCrafting.addShaped(CreativeAuraPump,[
[ArcanePrism,GreenGem,GreenGem,GreenGem,GreenGem,GreenGem,GreenGem,GreenGem,ArcanePrism],
[AngelSteel1,AuraManipulatorBlack,MultiAuraRepeater,AuraConductingIngot,AuraConductingIngot,AuraConductingIngot,MultiAuraRepeater,AuraManipulatorBlack,AngelSteel1],
[AngelSteel1,MultiAuraRepeater,AuraManipulatorBlack,MultiAuraRepeater,AuraConductingIngot,MultiAuraRepeater,AuraManipulatorBlack,MultiAuraRepeater,AngelSteel1],
[AngelSteel1,BlackGem,MultiAuraRepeater,AuraManipulatorBlack,AuraConductingIngot,AuraManipulatorBlack,MultiAuraRepeater,BlackGem,AngelSteel1],
[AngelSteel1,RangeExpander,AeonSteel,PortableRedHole,InfinityCatalyst,PortableRedHole,AeonSteel,RangeExpander,AngelSteel1],
[AngelSteel1,BlackGem,MultiAuraRepeater,AuraManipulatorOrange,AlternatingRedstonePump,AuraManipulatorOrange,MultiAuraRepeater,BlackGem,AngelSteel1],
[AngelSteel1,MultiAuraRepeater,AuraManipulatorOrange,AlternatingBurningPump,AlternatingBurningPump,AlternatingBurningPump,AuraManipulatorOrange,MultiAuraRepeater,AngelSteel1],
[AngelSteel1,AuraManipulatorOrange,AlternatingIlluminationPump,AlternatingIlluminationPump,AlternatingIlluminationPump,AlternatingIlluminationPump,AlternatingIlluminationPump,AuraManipulatorOrange,AngelSteel1],
[ArcanePrism,AngelSteel1,AngelSteel1,AngelSteel1,AngelSteel1,AngelSteel1,AngelSteel1,AngelSteel1,ArcanePrism]
]);
