Attempt to fix 1.16.3 branch's issues on the repository
Added the original 'wayoftime' folder back, so see if that fixed the multiple folder issue.
This commit is contained in:
parent
6b4145a67c
commit
9fa68e86ae
224 changed files with 24047 additions and 0 deletions
|
@ -0,0 +1,62 @@
|
|||
package wayoftime.bloodmagic.compat.jei;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.JeiPlugin;
|
||||
import mezz.jei.api.helpers.IJeiHelpers;
|
||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.registration.IRecipeRegistration;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
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.altar.BloodAltarRecipeCategory;
|
||||
import wayoftime.bloodmagic.compat.jei.array.AlchemyArrayCraftingCategory;
|
||||
import wayoftime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
||||
|
||||
@JeiPlugin
|
||||
public class BloodMagicJEIPlugin implements IModPlugin
|
||||
{
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
private static final ResourceLocation ID = BloodMagic.rl("jei_plugin");
|
||||
|
||||
@Override
|
||||
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration)
|
||||
{
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicBlocks.SOUL_FORGE.get()), TartaricForgeRecipeCategory.UID);
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicBlocks.BLOOD_ALTAR.get()), BloodAltarRecipeCategory.UID);
|
||||
registration.addRecipeCatalyst(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()), AlchemyArrayCraftingCategory.UID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCategories(IRecipeCategoryRegistration registration)
|
||||
{
|
||||
jeiHelper = registration.getJeiHelpers();
|
||||
registration.addRecipeCategories(new TartaricForgeRecipeCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
registration.addRecipeCategories(new BloodAltarRecipeCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
registration.addRecipeCategories(new AlchemyArrayCraftingCategory(registration.getJeiHelpers().getGuiHelper()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes(IRecipeRegistration registration)
|
||||
{
|
||||
ClientWorld world = Objects.requireNonNull(Minecraft.getInstance().world);
|
||||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForgeRecipes(world), TartaricForgeRecipeCategory.UID);
|
||||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes(world), BloodAltarRecipeCategory.UID);
|
||||
registration.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArrayRecipes(world), AlchemyArrayCraftingCategory.UID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getPluginUid()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
package wayoftime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
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.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.api.impl.recipe.RecipeBloodAltar;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.util.ChatUtil;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
import wayoftime.bloodmagic.util.helper.NumeralHelper;
|
||||
import wayoftime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class BloodAltarRecipeCategory implements IRecipeCategory<RecipeBloodAltar>
|
||||
{
|
||||
private static final int INPUT_SLOT = 1;
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
public static final ResourceLocation UID = BloodMagic.rl(Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
private final IDrawable icon;
|
||||
// @Nonnull
|
||||
// private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public BloodAltarRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
icon = guiHelper.createDrawableIngredient(new ItemStack(BloodMagicBlocks.BLOOD_ALTAR.get()));
|
||||
background = guiHelper.createDrawable(BloodMagic.rl("gui/jei/altar.png"), 3, 4, 155, 65);
|
||||
// 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.altar");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RecipeBloodAltar recipe, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 125, 30);
|
||||
guiItemStacks.init(INPUT_SLOT, true, 31, 0);
|
||||
|
||||
guiItemStacks.set(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends RecipeBloodAltar> getRecipeClass()
|
||||
{
|
||||
return RecipeBloodAltar.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(RecipeBloodAltar recipe, IIngredients ingredients)
|
||||
{
|
||||
ingredients.setInputIngredients(recipe.getIngredients());
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package wayoftime.bloodmagic.compat.jei.array;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
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.util.ResourceLocation;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
import wayoftime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyArrayCraftingCategory implements IRecipeCategory<RecipeAlchemyArray>
|
||||
{
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int INPUT_SLOT = 1;
|
||||
private static final int CATALYST_SLOT = 2;
|
||||
public static final ResourceLocation UID = BloodMagic.rl(Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
private final IDrawable icon;
|
||||
// @Nonnull
|
||||
// private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public AlchemyArrayCraftingCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
icon = guiHelper.createDrawableIngredient(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()));
|
||||
background = guiHelper.createDrawable(BloodMagic.rl("gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
// craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUid()
|
||||
{
|
||||
return UID;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return TextHelper.localize("jei.bloodmagic.recipe.alchemyarraycrafting");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RecipeAlchemyArray recipe, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
|
||||
|
||||
guiItemStacks.set(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends RecipeAlchemyArray> getRecipeClass()
|
||||
{
|
||||
return RecipeAlchemyArray.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(RecipeAlchemyArray recipe, IIngredients ingredients)
|
||||
{
|
||||
ingredients.setInputIngredients(recipe.getIngredients());
|
||||
ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,172 @@
|
|||
package wayoftime.bloodmagic.compat.jei.forge;
|
||||
|
||||
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 net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.api.impl.recipe.RecipeTartaricForge;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.util.ChatUtil;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
import wayoftime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory<RecipeTartaricForge>
|
||||
{
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int GEM_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
public static final ResourceLocation UID = BloodMagic.rl(Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background;
|
||||
private final IDrawable icon;
|
||||
// @Nonnull
|
||||
// private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public TartaricForgeRecipeCategory(IGuiHelper guiHelper)
|
||||
{
|
||||
icon = guiHelper.createDrawableIngredient(new ItemStack(BloodMagicBlocks.SOUL_FORGE.get()));
|
||||
background = guiHelper.createDrawable(BloodMagic.rl("gui/jei/soulforge.png"), 0, 0, 100, 40);
|
||||
// craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getUid()
|
||||
{
|
||||
return UID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ITextComponent> getTooltipStrings(RecipeTartaricForge recipe, double mouseX, double mouseY)
|
||||
{
|
||||
List<ITextComponent> tooltip = Lists.newArrayList();
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34)
|
||||
{
|
||||
tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.minimumsouls", ChatUtil.DECIMAL_FORMAT.format(recipe.getMinimumSouls())));
|
||||
tooltip.add(new TranslationTextComponent("jei.bloodmagic.recipe.soulsdrained", ChatUtil.DECIMAL_FORMAT.format(recipe.getSoulDrain())));
|
||||
}
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return TextHelper.localize("jei.bloodmagic.recipe.soulforge");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull RecipeTartaricForge recipe, @Nonnull IIngredients ingredients)
|
||||
{
|
||||
List<ItemStack> validGems = Lists.newArrayList();
|
||||
for (DefaultWill will : DefaultWill.values())
|
||||
{
|
||||
if (will.minSouls >= recipe.getMinimumSouls())
|
||||
{
|
||||
validGems.add(will.willStack);
|
||||
}
|
||||
}
|
||||
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 73, 13);
|
||||
|
||||
guiItemStacks.init(GEM_SLOT, true, 42, 0);
|
||||
|
||||
for (int y = 0; y < 2; ++y)
|
||||
{
|
||||
for (int x = 0; x < 2; ++x)
|
||||
{
|
||||
int index = INPUT_SLOT + x + (y * 2);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18);
|
||||
}
|
||||
}
|
||||
|
||||
guiItemStacks.set(GEM_SLOT, validGems);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(VanillaTypes.ITEM).get(0));
|
||||
guiItemStacks.set(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends RecipeTartaricForge> getRecipeClass()
|
||||
{
|
||||
return RecipeTartaricForge.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(RecipeTartaricForge recipe, IIngredients ingredients)
|
||||
{
|
||||
List<ItemStack> validGems = Lists.newArrayList();
|
||||
for (DefaultWill will : DefaultWill.values())
|
||||
{
|
||||
if (will.minSouls >= recipe.getMinimumSouls())
|
||||
{
|
||||
validGems.add(will.willStack);
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack[] validGemStacks = new ItemStack[validGems.size()];
|
||||
for (int i = 0; i < validGemStacks.length; i++)
|
||||
{
|
||||
validGemStacks[i] = validGems.get(i);
|
||||
}
|
||||
|
||||
List<Ingredient> ingList = Lists.newArrayList();
|
||||
ingList.add(Ingredient.fromStacks(validGemStacks));
|
||||
ingList.addAll(recipe.getInput());
|
||||
|
||||
ingredients.setInputIngredients(ingList);
|
||||
ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput());
|
||||
}
|
||||
|
||||
public enum DefaultWill
|
||||
{
|
||||
SOUL(new ItemStack(BloodMagicItems.MONSTER_SOUL_RAW.get()), 64),
|
||||
PETTY(new ItemStack(BloodMagicItems.PETTY_GEM.get()), 64),
|
||||
LESSER(new ItemStack(BloodMagicItems.LESSER_GEM.get()), 256),
|
||||
COMMON(new ItemStack(BloodMagicItems.COMMON_GEM.get()), 1024);
|
||||
// GREATER(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 3), 4096),
|
||||
// GRAND(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 4), 16384);
|
||||
|
||||
public final ItemStack willStack;
|
||||
public final double minSouls;
|
||||
|
||||
DefaultWill(ItemStack willStack, double minSouls)
|
||||
{
|
||||
this.willStack = willStack;
|
||||
this.minSouls = minSouls;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue