// Priority is set to -50 to ensure that all integration is completed before stage initialization. CrT recipes should be registered prior
// to this point. The actual staging script will fire at priority -99.
#priority -40

import crafttweaker.item.IIngredient;
import crafttweaker.enchantments.IEnchantmentDefinition;

import scripts.gamestages.classes.gamestage.GameStage;

static stageName as string = "arcane_mastery";

/**
 *  List of modids that will be staged. Specific unstaged items can be specified in the stagedNamesBlacklist.
 */
static stagedMods as string[] = [];

/**
 *  Staged items.
 */
static stagedItems as IIngredient[] = [
	<contenttweaker:essence_occultism>,
	<contenttweaker:essence_artificing>,
	<contenttweaker:essence_druidity>,
	<bloodmagic:sacrificial_dagger:1>,
	<bewitchment:blessed_stone>,
	<botania:pool:1>,
	<botania:manatablet:0>.withTag({mana: 500000, creative: 1 as byte}),
	<thaumcraft:creative_flux_sponge>,
	<roots:creative_pouch>,
	<thaumicwonders:creative_essentia_jar>,
	<thaumicaugmentation:rift_seed>,
	<thaumicenergistics:essentia_cell_creative>,
	<mysticalmechanics:creative_mech_source>,
	<embers:creative_ember_source>
];

/**
 *  Names of recipes that will be staged. These only need to be set if there are different recipes for the same item in different stages.
 */
static stagedRecipeNames as string[] = [];

/**
 * Mobs that will only spawn around players with this stage unlocked.
 */
static stagedMobs as string[] = [];

/**
 *  Enchantments that will only appear if the player has this stage.
 */
static stagedEnchants as IEnchantmentDefinition[] = [];

/**
 *  JEI categories that will be hidden until the player unlocks this stage.
 */
static stagedJeiCategories as string[] = [];

/**
 *  The partial names of any items that will be exluded during mod staging. This is useful to keep saplings or wood unstaged.
 */
static stagedNamesBlacklist as string[] = [];

/**
 *  The partial names of any items that will be excluded from any blacklist overlap. This is useful to ensure specific items are staged when there is overlap.
 */
static stagedNamesWhitelist as string[] = [];

/**
 *  This function does not actually stage the items. It is used to create the GameStage object that will be used during the actual staging.
 */
function initStage() as GameStage {
    val stage = GameStage(stageName);

    stage.setStagedMods(stagedMods);
    stage.setStagedItems(stagedItems);
    stage.setStagedRecipeNames(stagedRecipeNames);
    stage.setStagedMobs(stagedMobs);
    stage.setStagedEnchants(stagedEnchants);
    stage.setStagedJeiCategories(stagedJeiCategories);

    stage.setNamesBlacklist(stagedNamesBlacklist);
    stage.setNamesWhitelist(stagedNamesWhitelist);

    return stage;
}