Attempt #1 at orb recipe handlers
They do not work, they are not initialized. i need a break. my brain hurts
This commit is contained in:
parent
b170654ed3
commit
142cefd9be
|
@ -28,6 +28,7 @@ public class ShapedBloodOrbRecipe implements IRecipe
|
||||||
private Object[] input = null;
|
private Object[] input = null;
|
||||||
public int width = 0;
|
public int width = 0;
|
||||||
public int height = 0;
|
public int height = 0;
|
||||||
|
private int tier;
|
||||||
private boolean mirrored = true;
|
private boolean mirrored = true;
|
||||||
|
|
||||||
public ShapedBloodOrbRecipe(Block result, Object... recipe)
|
public ShapedBloodOrbRecipe(Block result, Object... recipe)
|
||||||
|
@ -237,6 +238,7 @@ public class ShapedBloodOrbRecipe implements IRecipe
|
||||||
if (slot != null && slot.getItem() instanceof IBloodOrb)
|
if (slot != null && slot.getItem() instanceof IBloodOrb)
|
||||||
{
|
{
|
||||||
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
||||||
|
tier = (Integer) target;
|
||||||
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) target)
|
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) target)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -296,4 +298,9 @@ public class ShapedBloodOrbRecipe implements IRecipe
|
||||||
|
|
||||||
return aitemstack;
|
return aitemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTier()
|
||||||
|
{
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -23,6 +23,7 @@ public class ShapelessBloodOrbRecipe implements IRecipe
|
||||||
{
|
{
|
||||||
private ItemStack output = null;
|
private ItemStack output = null;
|
||||||
private ArrayList<Object> input = new ArrayList<Object>();
|
private ArrayList<Object> input = new ArrayList<Object>();
|
||||||
|
private int tier;
|
||||||
|
|
||||||
public ShapelessBloodOrbRecipe(Block result, Object... recipe)
|
public ShapelessBloodOrbRecipe(Block result, Object... recipe)
|
||||||
{
|
{
|
||||||
|
@ -130,9 +131,10 @@ public class ShapelessBloodOrbRecipe implements IRecipe
|
||||||
// orb value of the item instead
|
// orb value of the item instead
|
||||||
if (next instanceof Integer)
|
if (next instanceof Integer)
|
||||||
{
|
{
|
||||||
if (slot != null && slot.getItem() instanceof IBloodOrb)
|
if (slot.getItem() instanceof IBloodOrb)
|
||||||
{
|
{
|
||||||
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
IBloodOrb orb = (IBloodOrb) slot.getItem();
|
||||||
|
tier = (Integer) next;
|
||||||
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) next)
|
if (orb.getOrbLevel(slot.getItemDamage()) < (Integer) next)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -188,4 +190,9 @@ public class ShapelessBloodOrbRecipe implements IRecipe
|
||||||
|
|
||||||
return aitemstack;
|
return aitemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTier()
|
||||||
|
{
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package WayofTime.bloodmagic.compat.jei;
|
package WayofTime.bloodmagic.compat.jei;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffectCrafting;
|
|
||||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingCategory;
|
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingCategory;
|
||||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeHandler;
|
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeHandler;
|
||||||
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeMaker;
|
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeMaker;
|
||||||
|
@ -15,8 +14,6 @@ import WayofTime.bloodmagic.registry.ModItems;
|
||||||
import mezz.jei.api.*;
|
import mezz.jei.api.*;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
@JEIPlugin
|
@JEIPlugin
|
||||||
public class BloodMagicPlugin implements IModPlugin
|
public class BloodMagicPlugin implements IModPlugin
|
||||||
{
|
{
|
||||||
|
@ -32,9 +29,17 @@ public class BloodMagicPlugin implements IModPlugin
|
||||||
@Override
|
@Override
|
||||||
public void register(IModRegistry registry)
|
public void register(IModRegistry registry)
|
||||||
{
|
{
|
||||||
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory());
|
registry.addRecipeCategories(
|
||||||
|
new AltarRecipeCategory(),
|
||||||
|
new BindingRecipeCategory(),
|
||||||
|
new AlchemyArrayCraftingCategory()
|
||||||
|
);
|
||||||
|
|
||||||
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler());
|
registry.addRecipeHandlers(
|
||||||
|
new AltarRecipeHandler(),
|
||||||
|
new BindingRecipeHandler(),
|
||||||
|
new AlchemyArrayCraftingRecipeHandler()
|
||||||
|
);
|
||||||
|
|
||||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package WayofTime.bloodmagic.compat.jei;
|
|
||||||
|
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public abstract class BloodMagicRecipeWrapper implements IRecipeWrapper
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<FluidStack> getFluidInputs()
|
|
||||||
{
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<FluidStack> getFluidOutputs()
|
|
||||||
{
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,11 +7,10 @@ import java.util.List;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicRecipeWrapper;
|
|
||||||
|
|
||||||
public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper
|
public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -23,7 +22,7 @@ public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
|
public AlchemyArrayCraftingRecipeJEI(@Nonnull ItemStack input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
|
||||||
{
|
{
|
||||||
this.inputs = Arrays.asList(new ItemStack[] { input, catalyst });
|
this.inputs = Arrays.asList(input, catalyst);
|
||||||
this.output = output;
|
this.output = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,16 +37,4 @@ public class AlchemyArrayCraftingRecipeJEI extends BloodMagicRecipeWrapper
|
||||||
{
|
{
|
||||||
return Collections.singletonList(output);
|
return Collections.singletonList(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.altar;
|
package WayofTime.bloodmagic.compat.jei.altar;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicRecipeWrapper;
|
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ import java.awt.*;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AltarRecipeJEI extends BloodMagicRecipeWrapper
|
public class AltarRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -47,10 +47,4 @@ public class AltarRecipeJEI extends BloodMagicRecipeWrapper
|
||||||
minecraft.fontRendererObj.drawString(infoString[0], 90 - minecraft.fontRendererObj.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
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.fontRendererObj.drawString(infoString[1], 90 - minecraft.fontRendererObj.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,10 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicRecipeWrapper;
|
|
||||||
|
|
||||||
public class BindingRecipeJEI extends BloodMagicRecipeWrapper
|
public class BindingRecipeJEI extends BlankRecipeWrapper
|
||||||
{
|
{
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -22,7 +21,7 @@ public class BindingRecipeJEI extends BloodMagicRecipeWrapper
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
|
public BindingRecipeJEI(@Nonnull ItemStack input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
|
||||||
{
|
{
|
||||||
this.inputs = Arrays.asList(new ItemStack[] { input, catalyst });
|
this.inputs = Arrays.asList(input, catalyst);
|
||||||
this.output = output;
|
this.output = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,16 +36,4 @@ public class BindingRecipeJEI extends BloodMagicRecipeWrapper
|
||||||
{
|
{
|
||||||
return Collections.singletonList(output);
|
return Collections.singletonList(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue