Search in sources :

Example 1 with EnumRuneType

use of WayofTime.bloodmagic.ritual.EnumRuneType in project BloodMagic by WayofTime.

the class CategoryRitual method buildCategory.

public static Map<ResourceLocation, EntryAbstract> buildCategory() {
    Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<>();
    addRitualPagesToEntries("intro", entries);
    addRitualPagesToEntries("basics", entries);
    List<IPage> ritualStonePages = new ArrayList<>();
    IRecipe ritualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_STONE));
    if (ritualStoneRecipe != null) {
        ritualStonePages.add(BookUtils.getPageForRecipe(ritualStoneRecipe));
    }
    ritualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ritualStone" + ".info.1"), 370));
    for (int i = 1; i < 5; i++) {
        EnumRuneType type = EnumRuneType.values()[i];
        AltarRecipe scribeRecipe = RecipeHelper.getAltarRecipeForOutput(type.getStack());
        if (scribeRecipe != null) {
            ritualStonePages.add(new PageAltarRecipe(scribeRecipe));
        }
    }
    ritualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ritualStone" + ".info.2"), 370));
    entries.put(new ResourceLocation(keyBase + "ritualStone"), new EntryText(ritualStonePages, TextHelper.localize(keyBase + "ritualStone"), true));
    List<IPage> masterRitualStonePages = new ArrayList<>();
    IRecipe masterRitualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER, 1, 0));
    if (masterRitualStoneRecipe != null) {
        masterRitualStonePages.add(BookUtils.getPageForRecipe(masterRitualStoneRecipe));
    }
    masterRitualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "masterRitualStone" + ".info"), 370));
    entries.put(new ResourceLocation(keyBase + "masterRitualStone"), new EntryText(masterRitualStonePages, TextHelper.localize(keyBase + "masterRitualStone"), true));
    List<IPage> activationCrystalPages = new ArrayList<>();
    activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.1"), 370));
    AltarRecipe crystalRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ACTIVATION_CRYSTAL));
    if (crystalRecipe != null) {
        activationCrystalPages.add(new PageAltarRecipe(crystalRecipe));
    }
    activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.2"), 370));
    entries.put(new ResourceLocation(keyBase + "activationCrystal"), new EntryText(activationCrystalPages, TextHelper.localize(keyBase + "activationCrystal"), true));
    List<IPage> divinerPages = new ArrayList<>();
    divinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "diviner" + ".info.1"), 370));
    IRecipe divinerRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.RITUAL_DIVINER));
    if (divinerRecipe != null) {
        divinerPages.add(BookUtils.getPageForRecipe(divinerRecipe));
    }
    divinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "diviner" + ".info.2"), 370));
    entries.put(new ResourceLocation(keyBase + "diviner"), new EntryText(divinerPages, TextHelper.localize(keyBase + "diviner"), true));
    addRitualPagesToEntries("fullSpring", entries);
    addRitualPagesToEntries("lava", entries);
    addRitualPagesToEntries("greenGrove", entries);
    addRitualPagesToEntries("magnetism", entries);
    addRitualPagesToEntries("crusher", entries);
    addRitualPagesToEntries("highJump", entries);
    addRitualPagesToEntries("speed", entries);
    addRitualPagesToEntries("wellOfSuffering", entries);
    addRitualPagesToEntries("featheredKnife", entries);
    addRitualPagesToEntries("regen", entries);
    addRitualPagesToEntries("harvest", entries);
    addRitualPagesToEntries("interdiction", entries);
    addRitualPagesToEntries("containment", entries);
    addRitualPagesToEntries("suppression", entries);
    addRitualPagesToEntries("expulsion", entries);
    addRitualPagesToEntries("zephyr", entries);
    addRitualPagesToEntries("laying", entries);
    addRitualPagesToEntries("timberman", entries);
    addRitualPagesToEntries("meteor", entries);
    addRitualPagesToEntries("downgrade", entries);
    for (Entry<ResourceLocation, EntryAbstract> entry : entries.entrySet()) {
        for (IPage page : entry.getValue().pageList) {
            if (page instanceof PageText) {
                ((PageText) page).setUnicodeFlag(true);
            }
        }
    }
    return entries;
}
Also used : EntryText(WayofTime.bloodmagic.compat.guideapi.entry.EntryText) PageAltarRecipe(WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe) EntryAbstract(amerifrance.guideapi.api.impl.abstraction.EntryAbstract) IRecipe(net.minecraft.item.crafting.IRecipe) ArrayList(java.util.ArrayList) PageText(amerifrance.guideapi.page.PageText) LinkedHashMap(java.util.LinkedHashMap) IPage(amerifrance.guideapi.api.IPage) EnumRuneType(WayofTime.bloodmagic.ritual.EnumRuneType) ResourceLocation(net.minecraft.util.ResourceLocation) AltarRecipe(WayofTime.bloodmagic.core.registry.AltarRecipeRegistry.AltarRecipe) PageAltarRecipe(WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe) ItemStack(net.minecraft.item.ItemStack)

Example 2 with EnumRuneType

use of WayofTime.bloodmagic.ritual.EnumRuneType in project BloodMagic by WayofTime.

the class ItemInscriptionTool method getSubItems.

@Override
@SideOnly(Side.CLIENT)
public void getSubItems(CreativeTabs creativeTab, NonNullList<ItemStack> list) {
    if (!isInCreativeTab(creativeTab))
        return;
    for (EnumRuneType runeType : types) {
        if (runeType == EnumRuneType.BLANK)
            continue;
        ItemStack stack = new ItemStack(this, 1, runeType.ordinal());
        NBTTagCompound tag = new NBTTagCompound();
        tag.setInteger(Constants.NBT.USES, 10);
        stack.setTagCompound(tag);
        list.add(stack);
    }
}
Also used : EnumRuneType(WayofTime.bloodmagic.ritual.EnumRuneType) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

EnumRuneType (WayofTime.bloodmagic.ritual.EnumRuneType)2 ItemStack (net.minecraft.item.ItemStack)2 EntryText (WayofTime.bloodmagic.compat.guideapi.entry.EntryText)1 PageAltarRecipe (WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe)1 AltarRecipe (WayofTime.bloodmagic.core.registry.AltarRecipeRegistry.AltarRecipe)1 IPage (amerifrance.guideapi.api.IPage)1 EntryAbstract (amerifrance.guideapi.api.impl.abstraction.EntryAbstract)1 PageText (amerifrance.guideapi.page.PageText)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 IRecipe (net.minecraft.item.crafting.IRecipe)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1