It compiles. Somehow.

This commit is contained in:
Nicholas Ignoffo 2017-08-15 20:21:54 -07:00
parent 554c9852e6
commit 348fee1e2a
150 changed files with 1029 additions and 2186 deletions

View file

@ -7,13 +7,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyCircleRenderer;
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
import WayofTime.bloodmagic.client.render.alchemyArray.DualAlchemyCircleRenderer;
import WayofTime.bloodmagic.compat.guideapi.page.PageAlchemyArray;
import WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer.ShapedBloodOrbRecipeRenderer;
import WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer.ShapelessBloodOrbRecipeRenderer;
import amerifrance.guideapi.page.PageIRecipe;
public class BookUtils
@ -72,14 +68,6 @@ public class BookUtils
public static PageIRecipe getPageForRecipe(IRecipe recipe)
{
if (recipe instanceof ShapedBloodOrbRecipe)
{
return new PageIRecipe(recipe, new ShapedBloodOrbRecipeRenderer((ShapedBloodOrbRecipe) recipe));
} else if (recipe instanceof ShapelessBloodOrbRecipe)
{
return new PageIRecipe(recipe, new ShapelessBloodOrbRecipeRenderer((ShapelessBloodOrbRecipe) recipe));
}
return new PageIRecipe(recipe);
}
}

View file

@ -50,6 +50,6 @@ public class GuideBloodMagic implements IGuideBook {
@Nullable
@Override
public IRecipe getRecipe(@Nonnull ItemStack bookStack) {
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "glass", "feather");
return new ShapelessOreRecipe(new ResourceLocation(BloodMagic.MODID, "guide"), GuideAPI.getStackFromBook(GUIDE_BOOK), new ItemStack(Items.BOOK), "glass", "feather").setRegistryName("guide");
}
}

View file

@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Map.Entry;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
@ -88,7 +89,7 @@ public class CategoryArchitect
List<IPage> weakorbPages = new ArrayList<IPage>();
weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 370));
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_WEAK));
AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK));
if (weakorbRecipe != null)
{
weakorbPages.add(new PageAltarRecipe(weakorbRecipe));
@ -196,7 +197,7 @@ public class CategoryArchitect
List<IPage> apprenticeorbPages = new ArrayList<IPage>();
AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_APPRENTICE));
AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE));
if (apprenticeorbRecipe != null)
{
apprenticeorbPages.add(new PageAltarRecipe(apprenticeorbRecipe));
@ -342,7 +343,7 @@ public class CategoryArchitect
List<IPage> magicianOrbPages = new ArrayList<IPage>();
AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_MAGICIAN));
AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN));
if (magicianOrbRecipe != null)
{
magicianOrbPages.add(new PageAltarRecipe(magicianOrbRecipe));
@ -538,7 +539,7 @@ public class CategoryArchitect
List<IPage> masterOrbPages = new ArrayList<IPage>();
AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagicItems.ORB_MASTER));
AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER));
if (magicianOrbRecipe != null)
{
masterOrbPages.add(new PageAltarRecipe(masterOrbRecipe));

View file

@ -1,79 +0,0 @@
package WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer;
import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
import amerifrance.guideapi.api.util.GuiHelper;
import amerifrance.guideapi.gui.GuiBase;
import amerifrance.guideapi.page.reciperenderer.BasicRecipeRenderer;
// TODO: Fix rendering of recipe
public class ShapedBloodOrbRecipeRenderer extends BasicRecipeRenderer<ShapedBloodOrbRecipe>
{
public ShapedBloodOrbRecipeRenderer(ShapedBloodOrbRecipe recipe)
{
super(recipe);
}
@SuppressWarnings("unchecked")
@Override
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
{
super.draw(book, category, entry, guiLeft, guiTop, mouseX, mouseY, guiBase, fontRendererObj);
for (int y = 0; y < recipe.height; y++)
{
for (int x = 0; x < recipe.width; x++)
{
int stackX = (x + 1) * 17 + (guiLeft + 29);
int stackY = (y + 1) * 17 + (guiTop + 40);
Object component = recipe.getInput()[y * recipe.width + x];
if (component != null)
{
if (component instanceof ItemStack)
{
ItemStack input = (ItemStack) component;
if (input.getItemDamage() == OreDictionary.WILDCARD_VALUE)
input.setItemDamage(0);
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip((ItemStack) component);
}
} else if (component instanceof Integer)
{
List<ItemStack> list = OrbRegistry.getOrbsDownToTier((Integer) component);
if (!list.isEmpty())
{
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
GuiHelper.drawItemStack(stack, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip(stack);
}
}
} else
{
List<ItemStack> list = (List<ItemStack>) component;
if (!list.isEmpty())
{
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
GuiHelper.drawItemStack(stack, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip(stack);
}
}
}
}
}
}
}
}

View file

@ -1,92 +0,0 @@
package WayofTime.bloodmagic.compat.guideapi.page.recipeRenderer;
import java.util.List;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
import amerifrance.guideapi.api.util.GuiHelper;
import amerifrance.guideapi.api.util.TextHelper;
import amerifrance.guideapi.gui.GuiBase;
import amerifrance.guideapi.page.reciperenderer.BasicRecipeRenderer;
public class ShapelessBloodOrbRecipeRenderer extends BasicRecipeRenderer<ShapelessBloodOrbRecipe>
{
public ShapelessBloodOrbRecipeRenderer(ShapelessBloodOrbRecipe recipe)
{
super(recipe);
}
@SuppressWarnings("unchecked")
@Override
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj)
{
super.draw(book, category, entry, guiLeft, guiTop, mouseX, mouseY, guiBase, fontRendererObj);
for (int y = 0; y < 3; y++)
{
for (int x = 0; x < 3; x++)
{
int i = 3 * y + x;
if (i >= recipe.getRecipeSize())
{
} else
{
int stackX = (x + 1) * 17 + (guiLeft + 29);
int stackY = (y + 1) * 17 + (guiTop + 40);
Object component = recipe.getInput().get(i);
if (component != null)
{
if (component instanceof ItemStack)
{
ItemStack input = (ItemStack) component;
if (input.getItemDamage() == OreDictionary.WILDCARD_VALUE)
input.setItemDamage(0);
GuiHelper.drawItemStack((ItemStack) component, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip((ItemStack) component);
}
} else if (component instanceof Integer)
{
List<ItemStack> list = OrbRegistry.getOrbsDownToTier((Integer) component);
if (!list.isEmpty())
{
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
GuiHelper.drawItemStack(stack, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip(stack);
}
}
} else
{
List<ItemStack> list = (List<ItemStack>) component;
if (!list.isEmpty())
{
ItemStack stack = list.get(getRandomizedCycle(x + (y * 3), list.size()));
GuiHelper.drawItemStack(stack, stackX, stackY);
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15))
{
tooltips = GuiHelper.getTooltip(stack);
}
}
}
}
}
}
}
}
@Override
protected String getRecipeName()
{
return TextHelper.localizeEffect("text.shapeless.crafting");
}
}

View file

@ -5,8 +5,8 @@ import java.util.Map;
import javax.annotation.Nonnull;
import mezz.jei.api.*;
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
@ -29,8 +29,6 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
import WayofTime.bloodmagic.compat.jei.orb.ShapedOrbRecipeHandler;
import WayofTime.bloodmagic.compat.jei.orb.ShapelessOrbRecipeHandler;
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
@ -44,9 +42,14 @@ public class BloodMagicPlugin extends BlankModPlugin
{
jeiHelper = registry.getJeiHelpers();
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory(), new TartaricForgeRecipeCategory(), new AlchemyTableRecipeCategory(), new ArmourDowngradeRecipeCategory());
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler(), new TartaricForgeRecipeHandler(), new AlchemyTableRecipeHandler(), new ArmourDowngradeRecipeHandler(), new ShapedOrbRecipeHandler(), new ShapelessOrbRecipeHandler());
registry.addRecipeHandlers(
new AltarRecipeHandler(),
new BindingRecipeHandler(),
new AlchemyArrayCraftingRecipeHandler(),
new TartaricForgeRecipeHandler(),
new AlchemyTableRecipeHandler(),
new ArmourDowngradeRecipeHandler()
);
registry.addRecipes(AltarRecipeMaker.getRecipes());
registry.addRecipes(BindingRecipeMaker.getRecipes());
@ -55,14 +58,8 @@ public class BloodMagicPlugin extends BlankModPlugin
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), "jei.bloodmagic.desc.altarBuilder");
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), "jei.bloodmagic.desc.demonicWill");
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_LIGHT));
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.SPECTRAL));
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.PHANTOM));
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_ARRAY));
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.DIMENSIONAL_PORTAL, 1, OreDictionary.WILDCARD_VALUE));
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), ItemStack.class, "jei.bloodmagic.desc.altarBuilder");
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), ItemStack.class, "jei.bloodmagic.desc.demonicWill");
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
{
@ -73,22 +70,37 @@ public class BloodMagicPlugin extends BlankModPlugin
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
LivingUpgrades.setKey(stack, key);
LivingUpgrades.setLevel(stack, i);
jeiHelper.getItemBlacklist().addItemToBlacklist(stack);
jeiHelper.getIngredientBlacklist().addIngredientToBlacklist(stack);
}
}
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
}
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
}
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {
if (jeiHelper == null)
jeiHelper = registry.getJeiHelpers();
registry.addRecipeCategories(
new AltarRecipeCategory(),
new BindingRecipeCategory(),
new AlchemyArrayCraftingCategory(),
new TartaricForgeRecipeCategory(),
new AlchemyTableRecipeCategory(),
new ArmourDowngradeRecipeCategory()
);
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.BloodMagic;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
@ -74,4 +75,9 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -33,7 +33,7 @@ public class AlchemyArrayCraftingRecipeMaker
ItemStack catalyst = entry.getKey().toStack();
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
{
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
recipes.add(recipe);

View file

@ -2,6 +2,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable;
import javax.annotation.Nonnull;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
@ -75,4 +76,9 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -5,7 +5,6 @@ import java.util.List;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
@ -14,7 +13,6 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
{
@Getter
private AlchemyTableRecipe recipe;
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
@ -41,4 +39,8 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
}
return ret;
}
public AlchemyTableRecipe getRecipe() {
return recipe;
}
}

View file

@ -5,6 +5,7 @@ import javax.annotation.Nullable;
import java.util.List;
import WayofTime.bloodmagic.BloodMagic;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
@ -72,4 +73,9 @@ public class AltarRecipeCategory implements IRecipeCategory
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -55,7 +55,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
{
minecraft.fontRendererObj.drawString(infoString[0], 90 - minecraft.fontRendererObj.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
minecraft.fontRendererObj.drawString(infoString[1], 90 - minecraft.fontRendererObj.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
minecraft.fontRenderer.drawString(infoString[0], 90 - minecraft.fontRenderer.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
minecraft.fontRenderer.drawString(infoString[1], 90 - minecraft.fontRenderer.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.BloodMagic;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
@ -94,4 +95,9 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
}
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -2,7 +2,6 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import com.google.common.collect.Lists;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
@ -14,7 +13,6 @@ import java.util.List;
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
{
@Getter
private LivingArmourDowngradeRecipe recipe;
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
@ -31,4 +29,8 @@ public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
ingredients.setOutput(ItemStack.class, upgradeStack);
}
public LivingArmourDowngradeRecipe getRecipe() {
return recipe;
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.binding;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.BloodMagic;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
@ -72,4 +73,9 @@ public class BindingRecipeCategory implements IRecipeCategory
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
}
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -33,7 +33,7 @@ public class BindingRecipeMaker
ItemStack catalyst = entry.getKey().toStack();
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
{
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
recipes.add(recipe);

View file

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.BloodMagic;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
@ -101,4 +102,9 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
craftingGridHelper.setInputs(guiItemStacks, inputs);
}
}
@Override
public String getModName() {
return BloodMagic.NAME;
}
}

View file

@ -6,7 +6,6 @@ import java.util.List;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import lombok.Getter;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import net.minecraft.item.ItemStack;
@ -16,9 +15,7 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
{
@Getter
private TartaricForgeRecipe recipe;
@Getter
private List<ItemStack> validGems = new ArrayList<ItemStack>();
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
@ -70,4 +67,12 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
this.minSouls = minSouls;
}
}
public TartaricForgeRecipe getRecipe() {
return recipe;
}
public List<ItemStack> getValidGems() {
return validGems;
}
}

View file

@ -1,40 +0,0 @@
package WayofTime.bloodmagic.compat.jei.orb;
import java.util.Arrays;
import javax.annotation.Nonnull;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
public class ShapedOrbRecipeHandler implements IRecipeHandler<ShapedBloodOrbRecipe>
{
@Nonnull
@Override
public Class<ShapedBloodOrbRecipe> getRecipeClass()
{
return ShapedBloodOrbRecipe.class;
}
@Nonnull
public String getRecipeCategoryUid(@Nonnull ShapedBloodOrbRecipe recipe)
{
return VanillaRecipeCategoryUid.CRAFTING;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapedBloodOrbRecipe recipe)
{
return new ShapedOrbRecipeJEI(Arrays.asList(recipe.getInput()), recipe.getTier(), recipe.getRecipeOutput());
}
@Override
public boolean isRecipeValid(@Nonnull ShapedBloodOrbRecipe recipe)
{
return recipe.getInput().length > 0;
}
}

View file

@ -1,68 +0,0 @@
package WayofTime.bloodmagic.compat.jei.orb;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import WayofTime.bloodmagic.util.helper.NumeralHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class ShapedOrbRecipeJEI extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
{
@Nonnull
private final List inputs;
private final int tier;
@Nonnull
private final ItemStack output;
@SuppressWarnings("unchecked")
public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
{
ArrayList inputList = new ArrayList(input);
for (Object object : inputList)
if (object instanceof Integer)
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
this.inputs = inputList;
this.tier = tier;
this.output = output;
}
@Override
public int getWidth()
{
return 3;
}
@Override
public int getHeight()
{
return 3;
}
@Override
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
ingredients.setInputLists(ItemStack.class, expanded);
ingredients.setOutput(ItemStack.class, output);
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
}
}

View file

@ -1,38 +0,0 @@
package WayofTime.bloodmagic.compat.jei.orb;
import javax.annotation.Nonnull;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
public class ShapelessOrbRecipeHandler implements IRecipeHandler<ShapelessBloodOrbRecipe>
{
@Nonnull
@Override
public Class<ShapelessBloodOrbRecipe> getRecipeClass()
{
return ShapelessBloodOrbRecipe.class;
}
@Override
public String getRecipeCategoryUid(@Nonnull ShapelessBloodOrbRecipe recipe)
{
return VanillaRecipeCategoryUid.CRAFTING;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapelessBloodOrbRecipe recipe)
{
return new ShapelessOrbRecipeJEI(recipe.getInput(), recipe.getTier(), recipe.getRecipeOutput());
}
@Override
public boolean isRecipeValid(@Nonnull ShapelessBloodOrbRecipe recipe)
{
return recipe.getInput().size() > 0;
}
}

View file

@ -1,58 +0,0 @@
package WayofTime.bloodmagic.compat.jei.orb;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import WayofTime.bloodmagic.util.helper.NumeralHelper;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import WayofTime.bloodmagic.api.registry.OrbRegistry;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class ShapelessOrbRecipeJEI extends BlankRecipeWrapper implements ICraftingRecipeWrapper
{
@Nonnull
private final List inputs;
private final int tier;
@Nonnull
private final ItemStack output;
@SuppressWarnings("unchecked")
public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
{
ArrayList inputList = new ArrayList(input);
for (Object object : inputList)
if (object instanceof Integer)
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
this.inputs = inputList;
this.tier = tier;
this.output = output;
}
@Override
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
ingredients.setInputLists(ItemStack.class, expanded);
ingredients.setOutput(ItemStack.class, output);
}
@Override
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
{
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
}
}