Readded the Alchemy Table
Finished adding the Alchemy Table with JEI compatability. Also added recipes for the ARC block and the Alchemy Table.
This commit is contained in:
parent
37c5e807b0
commit
bf6250272c
41 changed files with 1915 additions and 29 deletions
|
@ -19,6 +19,7 @@ import wayoftime.bloodmagic.BloodMagic;
|
|||
import wayoftime.bloodmagic.api.impl.BloodMagicAPI;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.compat.jei.alchemytable.AlchemyTableRecipeCategory;
|
||||
import wayoftime.bloodmagic.compat.jei.altar.BloodAltarRecipeCategory;
|
||||
import wayoftime.bloodmagic.compat.jei.arc.ARCFurnaceRecipeCategory;
|
||||
import wayoftime.bloodmagic.compat.jei.arc.ARCRecipeCategory;
|
||||
|
@ -40,6 +41,7 @@ public class BloodMagicJEIPlugin implements IModPlugin
|
|||
registration.addRecipeCatalyst(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()), AlchemyArrayCraftingCategory.UID);
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicBlocks.ALCHEMICAL_REACTION_CHAMBER.get()), ARCRecipeCategory.UID);
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicBlocks.ALCHEMICAL_REACTION_CHAMBER.get()), ARCFurnaceRecipeCategory.UID);
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicBlocks.ALCHEMY_TABLE.get()), AlchemyTableRecipeCategory.UID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,6 +53,7 @@ public class BloodMagicJEIPlugin implements IModPlugin
|
|||
registration.addRecipeCategories(new AlchemyArrayCraftingCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
registration.addRecipeCategories(new ARCRecipeCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
registration.addRecipeCategories(new ARCFurnaceRecipeCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
registration.addRecipeCategories(new AlchemyTableRecipeCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +65,7 @@ public class BloodMagicJEIPlugin implements IModPlugin
|
|||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArrayRecipes(world), AlchemyArrayCraftingCategory.UID);
|
||||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getARCRecipes(world), ARCRecipeCategory.UID);
|
||||
registration.addRecipes(ImmutableSet.copyOf(world.getRecipeManager().getRecipesForType(IRecipeType.SMELTING)), ARCFurnaceRecipeCategory.UID);
|
||||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyTableRecipes(world), AlchemyTableRecipeCategory.UID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,152 @@
|
|||
package wayoftime.bloodmagic.compat.jei.alchemytable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import mezz.jei.api.constants.VanillaTypes;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
||||
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
|
||||
import mezz.jei.api.helpers.IGuiHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.api.impl.recipe.RecipeAlchemyTable;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.core.registry.OrbRegistry;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
import wayoftime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyTableRecipeCategory implements IRecipeCategory<RecipeAlchemyTable>
|
||||
{
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int ORB_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
public static final ResourceLocation UID = BloodMagic.rl(Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
private final IDrawable icon;
|
||||
// @Nonnull
|
||||
// private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public AlchemyTableRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
icon = guiHelper.createDrawableIngredient(new ItemStack(BloodMagicBlocks.ALCHEMY_TABLE.get()));
|
||||
background = guiHelper.createDrawable(BloodMagic.rl("gui/jei/alchemytable.png"), 0, 0, 118, 40);
|
||||
// craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUid()
|
||||
{
|
||||
return UID;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<ITextComponent> getTooltipStrings(RecipeBloodAltar recipe, double mouseX, double mouseY)
|
||||
// {
|
||||
// List<ITextComponent> tooltip = Lists.newArrayList();
|
||||
//
|
||||
// if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58)
|
||||
// {
|
||||
// tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.consumptionrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getConsumeRate())));
|
||||
// tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.drainrate", ChatUtil.DECIMAL_FORMAT.format(recipe.getDrainRate())));
|
||||
// }
|
||||
//
|
||||
// return tooltip;
|
||||
// }
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return TextHelper.localize("jei.bloodmagic.recipe.alchemytable");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RecipeAlchemyTable recipe, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 91, 13);
|
||||
guiItemStacks.init(ORB_SLOT, true, 60, 0);
|
||||
|
||||
for (int y = 0; y < 2; ++y)
|
||||
{
|
||||
for (int x = 0; x < 3; ++x)
|
||||
{
|
||||
int index = INPUT_SLOT + x + (y * 3);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18);
|
||||
}
|
||||
}
|
||||
// guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipe.getMinimumTier()));
|
||||
// guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
|
||||
// guiItemStacks.init(OUTPUT_SLOT, false, 125, 30);
|
||||
// guiItemStacks.init(INPUT_SLOT, true, 31, 0);
|
||||
// craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
|
||||
guiItemStacks.set(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends RecipeAlchemyTable> getRecipeClass()
|
||||
{
|
||||
return RecipeAlchemyTable.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(RecipeAlchemyTable recipe, IIngredients ingredients)
|
||||
{
|
||||
List<ItemStack> validOrbs = OrbRegistry.getOrbsDownToTier(recipe.getMinimumTier());
|
||||
|
||||
ItemStack[] validOrbStacks = new ItemStack[validOrbs.size()];
|
||||
for (int i = 0; i < validOrbStacks.length; i++)
|
||||
{
|
||||
validOrbStacks[i] = validOrbs.get(i);
|
||||
}
|
||||
|
||||
List<Ingredient> ingList = Lists.newArrayList();
|
||||
ingList.add(Ingredient.fromStacks(validOrbStacks));
|
||||
ingList.addAll(recipe.getInput());
|
||||
ingredients.setInputIngredients(ingList);
|
||||
ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput());
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void draw(RecipeBloodAltar recipe, MatrixStack matrixStack, double mouseX, double mouseY)
|
||||
// {
|
||||
// Minecraft mc = Minecraft.getInstance();
|
||||
// String[] infoString = new String[]
|
||||
// { TextHelper.localize("jei.bloodmagic.recipe.requiredtier", NumeralHelper.toRoman(recipe.getMinimumTier().toInt())),
|
||||
// TextHelper.localize("jei.bloodmagic.recipe.requiredlp", recipe.getSyphon()) };
|
||||
// mc.fontRenderer.drawString(matrixStack, infoString[0], 90
|
||||
// - mc.fontRenderer.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
||||
// mc.fontRenderer.drawString(matrixStack, infoString[1], 90
|
||||
// - mc.fontRenderer.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||
// }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue