Updated The Architect section of the documentation
This commit is contained in:
parent
6aff707708
commit
1c66a2fc61
7 changed files with 159 additions and 35 deletions
|
@ -35,11 +35,11 @@ public class GuideBloodMagic
|
|||
|
||||
public static void initCategories()
|
||||
{
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryAlchemy.buildCategory(), "guide.BloodMagic.category.alchemy", new ItemStack(ModItems.arcaneAshes)));
|
||||
// guideBook.addCategory(new CategoryItemStack(CategoryAlchemy.buildCategory(), "guide.BloodMagic.category.alchemy", new ItemStack(ModItems.arcaneAshes)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryArchitect.buildCategory(), "guide.BloodMagic.category.architect", new ItemStack(ModItems.sigilDivination)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryDemon.buildCategory(), "guide.BloodMagic.category.demon", new ItemStack(ModItems.bloodShard)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryRitual.buildCategory(), "guide.BloodMagic.category.ritual", new ItemStack(ModBlocks.ritualController)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.BloodMagic.category.spell", new ItemStack(ModItems.ritualDiviner)));
|
||||
// guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.BloodMagic.category.spell", new ItemStack(ModItems.ritualDiviner)));
|
||||
}
|
||||
|
||||
public static void initJEIBlacklist()
|
||||
|
|
|
@ -1,20 +1,104 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi.book;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry.AltarRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.compat.guideapi.entry.EntryText;
|
||||
import WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.util.helper.RecipeHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import amerifrance.guideapi.api.IPage;
|
||||
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.util.PageHelper;
|
||||
import amerifrance.guideapi.page.PageIRecipe;
|
||||
|
||||
public class CategoryArchitect
|
||||
{
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory() {
|
||||
|
||||
public static Map<ResourceLocation, EntryAbstract> buildCategory()
|
||||
{
|
||||
Map<ResourceLocation, EntryAbstract> entries = new LinkedHashMap<ResourceLocation, EntryAbstract>();
|
||||
String keyBase = Constants.Mod.DOMAIN + "architect_";
|
||||
String keyBase = "guide." + Constants.Mod.MODID + ".entry.architect.";
|
||||
|
||||
List<IPage> introPages = new ArrayList<IPage>();
|
||||
introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 270));
|
||||
// introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png")));
|
||||
entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), false));
|
||||
|
||||
List<IPage> altarPages = new ArrayList<IPage>();
|
||||
|
||||
IRecipe altarRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(ModBlocks.altar));
|
||||
if (altarRecipe != null)
|
||||
{
|
||||
altarPages.add(new PageIRecipe(altarRecipe));
|
||||
}
|
||||
|
||||
altarPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodaltar" + ".info.1"), 270));
|
||||
|
||||
IRecipe daggerRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(ModItems.sacrificialDagger));
|
||||
if (daggerRecipe != null)
|
||||
{
|
||||
altarPages.add(new PageIRecipe(daggerRecipe));
|
||||
}
|
||||
|
||||
altarPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodaltar" + ".info.2"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "bloodaltar"), new EntryText(altarPages, TextHelper.localize(keyBase + "bloodaltar"), false));
|
||||
|
||||
List<IPage> ashPages = new ArrayList<IPage>();
|
||||
//TODO: Arcane Ash Recipe
|
||||
|
||||
ashPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ash" + ".info"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "ash"), new EntryText(ashPages, TextHelper.localize(keyBase + "ash"), false));
|
||||
|
||||
List<IPage> divinationPages = new ArrayList<IPage>();
|
||||
//TODO: Divination Sigil Recipe
|
||||
divinationPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "divination" + ".info"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "divination"), new EntryText(divinationPages, TextHelper.localize(keyBase + "divination"), false));
|
||||
|
||||
List<IPage> soulnetworkPages = new ArrayList<IPage>();
|
||||
|
||||
soulnetworkPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "soulnetwork" + ".info"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "soulnetwork"), new EntryText(soulnetworkPages, TextHelper.localize(keyBase + "soulnetwork"), false));
|
||||
|
||||
List<IPage> weakorbPages = new ArrayList<IPage>();
|
||||
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 270));
|
||||
|
||||
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(ModItems.orbWeak));
|
||||
if (weakorbRecipe != null)
|
||||
{
|
||||
weakorbPages.add(new PageAltarRecipe(weakorbRecipe));
|
||||
}
|
||||
|
||||
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.2"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "weakorb"), new EntryText(weakorbPages, TextHelper.localize(keyBase + "weakorb"), false));
|
||||
|
||||
List<IPage> incensePages = new ArrayList<IPage>();
|
||||
|
||||
// IRecipe incenseRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(ModBlocks.incenseAltar));
|
||||
// if (incenseRecipe != null)
|
||||
// {
|
||||
// incensePages.add(new PageIRecipe(incenseRecipe));
|
||||
// }
|
||||
|
||||
incensePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "incense" + ".info.1"), 270));
|
||||
|
||||
// IRecipe woodPathRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(ModBlocks.pathBlock, 1, 0));
|
||||
// if (woodPathRecipe != null)
|
||||
// {
|
||||
// incensePages.add(new PageIRecipe(woodPathRecipe));
|
||||
// }
|
||||
|
||||
incensePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "incense" + ".info.2"), 270));
|
||||
entries.put(new ResourceLocation(keyBase + "incense"), new EntryText(incensePages, TextHelper.localize(keyBase + "incense"), false));
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ public class CategoryDemon
|
|||
introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 270));
|
||||
// introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png")));
|
||||
entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), false));
|
||||
// CraftingManager.getInstance().g
|
||||
|
||||
List<IPage> snarePages = new ArrayList<IPage>();
|
||||
snarePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "snare" + ".info.1"), 270));
|
||||
|
|
|
@ -19,14 +19,16 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class PageAltarRecipe extends Page {
|
||||
public class PageAltarRecipe extends Page
|
||||
{
|
||||
|
||||
public List<ItemStack> input;
|
||||
public ItemStack output;
|
||||
public int tier;
|
||||
public int bloodRequired;
|
||||
|
||||
public PageAltarRecipe(AltarRecipeRegistry.AltarRecipe recipe) {
|
||||
public PageAltarRecipe(AltarRecipeRegistry.AltarRecipe recipe)
|
||||
{
|
||||
this.input = recipe.getInput();
|
||||
this.output = recipe.getOutput();
|
||||
this.tier = recipe.getMinTier().toInt();
|
||||
|
@ -35,36 +37,40 @@ public class PageAltarRecipe extends Page {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("alchemicalwizardry" + ":textures/gui/guide/altar.png"));
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer)
|
||||
{
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/altar.png"));
|
||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104);
|
||||
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.recipe.altar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.bloodAltar"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
|
||||
|
||||
int inputX = (1 + 1) * 20 + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int inputY = (20) + (guiTop + guiBase.ySize / 5) - 1; //1 * 20
|
||||
GuiHelper.drawItemStack(input.get(0), inputX, inputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15)) {
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, inputX, inputY, 15, 15))
|
||||
{
|
||||
guiBase.renderToolTip(input.get(0), mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (output == null) {
|
||||
if (output == null)
|
||||
{
|
||||
output = new ItemStack(Blocks.BARRIER);
|
||||
}
|
||||
int outputX = (5 * 20) + (guiLeft + guiBase.xSize / 7) + 1;
|
||||
int outputY = (20) + (guiTop + guiBase.xSize / 5) - 1; // 1 * 20
|
||||
GuiHelper.drawItemStack(output, outputX, outputY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15)) {
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, outputX, outputY, 15, 15))
|
||||
{
|
||||
guiBase.renderToolTip(output, outputX, outputY);
|
||||
}
|
||||
|
||||
if (output.getItem() == Item.getItemFromBlock(Blocks.BARRIER)) {
|
||||
if (output.getItem() == Item.getItemFromBlock(Blocks.BARRIER))
|
||||
{
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.furnace.error"), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0xED073D);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("bm.string.tier") + ": " + String.valueOf(tier), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, "LP: " + String.valueOf(bloodRequired), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 30, 0);
|
||||
}
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.recipe.altar.tier", String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("text.recipe.altar.bloodRequired", String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.tier", String.valueOf(tier)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6, 0);
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.lp", String.valueOf(bloodRequired)), guiLeft + guiBase.xSize / 2, guiTop + 4 * guiBase.ySize / 6 + 15, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package WayofTime.bloodmagic.util.helper;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
@ -28,6 +29,26 @@ public class RecipeHelper
|
|||
return null;
|
||||
}
|
||||
|
||||
public static AltarRecipeRegistry.AltarRecipe getAltarRecipeForOutput(ItemStack stack)
|
||||
{
|
||||
for (AltarRecipeRegistry.AltarRecipe recipe : AltarRecipeRegistry.getRecipes().values())
|
||||
{
|
||||
if (recipe != null)
|
||||
{
|
||||
ItemStack resultStack = recipe.getOutput();
|
||||
if (resultStack != null && resultStack.getItem() != null)
|
||||
{
|
||||
if (resultStack.getItem() == stack.getItem() && resultStack.getItemDamage() == stack.getItemDamage())
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TartaricForgeRecipe getForgeRecipeForOutput(ItemStack stack)
|
||||
{
|
||||
for (TartaricForgeRecipe recipe : TartaricForgeRecipeRegistry.getRecipeList())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue