OreDict Altar Recipes!

OreDict support for altar and alchemy array recipes!
Changed the alchemy array JEI image

Recipe modularizations

Fix

Like this?

Tehnut patch

Change to List<ItemStack>
This commit is contained in:
Arcaratus 2016-03-25 10:07:30 -04:00
parent f9cb1a08ba
commit 800ffa213b
11 changed files with 249 additions and 102 deletions

View file

@ -7,7 +7,6 @@ import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.api.Constants;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
@ -61,16 +60,15 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
{
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
{
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(0));
recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) alchemyArrayWrapper.getInputs().get(1));
recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs().subList(0, alchemyArrayWrapper.getInputs().size() - 1));
recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst());
recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs());
}
}

View file

@ -13,22 +13,31 @@ import net.minecraft.item.ItemStack;
public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
{
@Nonnull
private final List<ItemStack> inputs;
private final Object inputs;
@Nullable
private final ItemStack catalyst;
@Nonnull
private final ItemStack output;
@SuppressWarnings("unchecked")
public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
public AlchemyArrayCraftingRecipeJEI(@Nonnull List<ItemStack> input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
{
this.inputs = Arrays.asList(input, catalyst);
this.inputs = input;
this.catalyst = catalyst;
this.output = output;
}
@Override
public List getInputs()
{
return inputs;
return Arrays.asList(inputs, catalyst);
}
public ItemStack getCatalyst()
{
return catalyst;
}
@Override

View file

@ -19,13 +19,13 @@ public class AlchemyArrayCraftingRecipeMaker
@Nonnull
public static List<AlchemyArrayCraftingRecipeJEI> getRecipes()
{
Map<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
Map<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
ArrayList<AlchemyArrayCraftingRecipeJEI> recipes = new ArrayList<AlchemyArrayCraftingRecipeJEI>();
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
{
ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack();
List<ItemStack> input = itemStackAlchemyArrayRecipeEntry.getValue().getInput();
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())

View file

@ -16,7 +16,7 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
public class AltarRecipeJEI extends BlankRecipeWrapper
{
@Nonnull
private final ItemStack input;
private final Object input;
@Nonnull
private final ItemStack output;
@ -25,7 +25,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
private final int consumptionRate;
private final int drainRate;
public AltarRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate)
public AltarRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack output, int tier, int requiredLP, int consumptionRate, int drainRate)
{
this.input = input;
this.output = output;

View file

@ -15,16 +15,16 @@ public class AltarRecipeMaker
@Nonnull
public static List<AltarRecipeJEI> getRecipes()
{
Map<ItemStack, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
Map<List<ItemStack>, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
for (Map.Entry<ItemStack, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet())
for (Map.Entry<List<ItemStack>, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet())
{
if (!(itemStackAltarRecipeEntry.getKey().getItem() instanceof IBloodOrb))
// Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that.
if (!(itemStackAltarRecipeEntry.getKey().get(0).getItem() instanceof IBloodOrb))
{
// Make sure input is not a Blood Orb. If it is, the recipe is for a filling orb, and we don't want that.
ItemStack input = itemStackAltarRecipeEntry.getKey();
List<ItemStack> input = itemStackAltarRecipeEntry.getValue().getInput();
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
int requiredLP = itemStackAltarRecipeEntry.getValue().getSyphon();

View file

@ -61,16 +61,15 @@ public class BindingRecipeCategory implements IRecipeCategory
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
{
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 50, 5);
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
if (recipeWrapper instanceof BindingRecipeJEI)
{
BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper;
recipeLayout.getItemStacks().set(INPUT_SLOT, (ItemStack) bindingRecipe.getInputs().get(0));
recipeLayout.getItemStacks().set(CATALYST_SLOT, (ItemStack) bindingRecipe.getInputs().get(1));
recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipe.getInputs());
recipeLayout.getItemStacks().set(CATALYST_SLOT, bindingRecipe.getCatalyst());
recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipe.getOutputs());
}
}

View file

@ -14,20 +14,29 @@ public class BindingRecipeJEI extends BlankRecipeWrapper
@Nonnull
private final List<ItemStack> inputs;
@Nonnull
private final ItemStack catalyst;
@Nonnull
private final ItemStack output;
@SuppressWarnings("unchecked")
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
public BindingRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
{
this.inputs = Arrays.asList(input, catalyst);
this.inputs = input;
this.catalyst = catalyst;
this.output = output;
}
@Override
public List getInputs()
{
return inputs;
return Arrays.asList(inputs, catalyst);
}
public ItemStack getCatalyst()
{
return catalyst;
}
@Override

View file

@ -19,13 +19,13 @@ public class BindingRecipeMaker
@Nonnull
public static List<BindingRecipeJEI> getRecipes()
{
Map<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
Map<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
ArrayList<BindingRecipeJEI> recipes = new ArrayList<BindingRecipeJEI>();
for (Map.Entry<ItemStackWrapper, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
{
ItemStack input = itemStackAlchemyArrayRecipeEntry.getValue().getInputStack();
List<ItemStack> input = itemStackAlchemyArrayRecipeEntry.getValue().getInput();
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())