Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -1,12 +1,5 @@
|
|||
package WayofTime.bloodmagic.compat.jei;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
|
@ -31,15 +24,19 @@ import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
|||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Map;
|
||||
|
||||
@JEIPlugin
|
||||
public class BloodMagicPlugin extends BlankModPlugin
|
||||
{
|
||||
public class BloodMagicPlugin extends BlankModPlugin {
|
||||
public static IJeiHelpers jeiHelper;
|
||||
|
||||
@Override
|
||||
public void register(@Nonnull IModRegistry registry)
|
||||
{
|
||||
public void register(@Nonnull IModRegistry registry) {
|
||||
jeiHelper = registry.getJeiHelpers();
|
||||
|
||||
registry.addRecipeHandlers(
|
||||
|
@ -61,12 +58,10 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
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())
|
||||
{
|
||||
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
int maxLevel = entry.getValue();
|
||||
for (int i = 0; i < maxLevel - 1; i++)
|
||||
{
|
||||
for (int i = 0; i < maxLevel - 1; i++) {
|
||||
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
LivingUpgrades.setKey(stack, key);
|
||||
LivingUpgrades.setLevel(stack, i);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -12,12 +12,11 @@ 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;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AlchemyArrayCraftingCategory implements IRecipeCategory {
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int CATALYST_SLOT = 1;
|
||||
private static final int OUTPUT_SLOT = 2;
|
||||
|
@ -29,47 +28,40 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
|
||||
{
|
||||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI) {
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
|
|
|
@ -1,36 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<AlchemyArrayCraftingRecipeJEI>
|
||||
{
|
||||
public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<AlchemyArrayCraftingRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlchemyArrayCraftingRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<AlchemyArrayCraftingRecipeJEI> getRecipeClass() {
|
||||
return AlchemyArrayCraftingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyArrayCraftingRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper {
|
||||
@Nonnull
|
||||
private final List<ItemStack> inputs;
|
||||
@Nullable
|
||||
|
@ -19,15 +17,13 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
|||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
public AlchemyArrayCraftingRecipeJEI(@Nonnull List<ItemStack> input, @Nullable ItemStack catalyst, @Nonnull ItemStack output)
|
||||
{
|
||||
public AlchemyArrayCraftingRecipeJEI(@Nonnull List<ItemStack> input, @Nullable ItemStack catalyst, @Nonnull ItemStack output) {
|
||||
this.inputs = input;
|
||||
this.catalyst = catalyst;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
public ItemStack getCatalyst()
|
||||
{
|
||||
public ItemStack getCatalyst() {
|
||||
return catalyst;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,38 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffectCrafting;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlchemyArrayCraftingRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AlchemyArrayCraftingRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<AlchemyArrayCraftingRecipeJEI> getRecipes() {
|
||||
Map<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AlchemyArrayCraftingRecipeJEI> recipes = new ArrayList<AlchemyArrayCraftingRecipeJEI>();
|
||||
|
||||
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) {
|
||||
List<ItemStack> input = itemStackAlchemyArrayRecipeEntry.getValue().getInput();
|
||||
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
|
||||
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet()) {
|
||||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
|
||||
{
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting) {
|
||||
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||
|
||||
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
|
@ -12,12 +13,10 @@ import mezz.jei.api.ingredients.IIngredients;
|
|||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI>
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI> {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int ORB_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
@ -29,44 +28,37 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
|
|||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public AlchemyTableRecipeCategory()
|
||||
{
|
||||
public AlchemyTableRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, AlchemyTableRecipeJEI recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(IRecipeLayout recipeLayout, AlchemyTableRecipeJEI recipeWrapper, 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 < 3; ++y)
|
||||
{
|
||||
for (int x = 0; x < 3; ++x)
|
||||
{
|
||||
for (int y = 0; y < 3; ++y) {
|
||||
for (int x = 0; x < 3; ++x) {
|
||||
int index = INPUT_SLOT + x + (y * 3);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18 - 18);
|
||||
}
|
||||
|
|
|
@ -1,36 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRecipeJEI>
|
||||
{
|
||||
public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AlchemyTableRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<AlchemyTableRecipeJEI> getRecipeClass() {
|
||||
return AlchemyTableRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyTableRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper {
|
||||
private AlchemyTableRecipe recipe;
|
||||
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
|
||||
{
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
|
@ -28,11 +26,9 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
|
||||
{
|
||||
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34) {
|
||||
ret.add(TextHelper.localize("tooltip.bloodmagic.tier", recipe.getTierRequired()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyTableRecipeRegistry;
|
||||
|
||||
public class AlchemyTableRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlchemyTableRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AlchemyTableRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<AlchemyTableRecipeJEI> getRecipes() {
|
||||
List<AlchemyTableRecipe> recipeList = AlchemyTableRecipeRegistry.getRecipeList();
|
||||
ArrayList<AlchemyTableRecipeJEI> recipes = new ArrayList<AlchemyTableRecipeJEI>();
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -14,12 +12,11 @@ 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;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AltarRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AltarRecipeCategory implements IRecipeCategory {
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int OUTPUT_SLOT = 1;
|
||||
|
||||
|
@ -30,28 +27,24 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -62,13 +55,11 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
|
||||
if (recipeWrapper instanceof AltarRecipeJEI)
|
||||
{
|
||||
if (recipeWrapper instanceof AltarRecipeJEI) {
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
|
|
|
@ -1,36 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
|
||||
{
|
||||
public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<AltarRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<AltarRecipeJEI> getRecipeClass() {
|
||||
return AltarRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull AltarRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AltarRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AltarRecipeJEI extends BlankRecipeWrapper {
|
||||
@Nonnull
|
||||
private final List<ItemStack> input;
|
||||
@Nonnull
|
||||
|
@ -24,12 +22,11 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
private final int consumptionRate;
|
||||
private final int drainRate;
|
||||
|
||||
public AltarRecipeJEI(@Nonnull List<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;
|
||||
|
||||
this.infoString = new String[] { TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP) };
|
||||
this.infoString = new String[]{TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP)};
|
||||
this.consumptionRate = consumptionRate;
|
||||
this.drainRate = drainRate;
|
||||
}
|
||||
|
@ -41,11 +38,9 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58)
|
||||
{
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
}
|
||||
|
@ -53,8 +48,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||
{
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -1,35 +1,30 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.orb.IBloodOrb;
|
||||
import WayofTime.bloodmagic.api.registry.AltarRecipeRegistry;
|
||||
import WayofTime.bloodmagic.block.BlockLifeEssence;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
public class AltarRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AltarRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<AltarRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<AltarRecipeJEI> getRecipes() {
|
||||
Map<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> altarMap = AltarRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<AltarRecipeJEI> recipes = new ArrayList<AltarRecipeJEI>();
|
||||
|
||||
for (Map.Entry<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<List<ItemStackWrapper>, AltarRecipeRegistry.AltarRecipe> itemStackAltarRecipeEntry : altarMap.entrySet()) {
|
||||
// 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).toStack().getItem() instanceof IBloodOrb))
|
||||
{
|
||||
if (!(itemStackAltarRecipeEntry.getKey().get(0).toStack().getItem() instanceof IBloodOrb)) {
|
||||
List<ItemStack> input = ItemStackWrapper.toStackList(itemStackAltarRecipeEntry.getValue().getInput());
|
||||
ItemStack output = itemStackAltarRecipeEntry.getValue().getOutput();
|
||||
int requiredTier = itemStackAltarRecipeEntry.getValue().getMinTier().toInt();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
|
@ -14,12 +14,11 @@ 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;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ArmourDowngradeRecipeCategory implements IRecipeCategory {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int KEY_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
@ -31,35 +30,30 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public ArmourDowngradeRecipeCategory()
|
||||
{
|
||||
public ArmourDowngradeRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -71,24 +65,20 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 91, 13);
|
||||
guiItemStacks.init(KEY_SLOT, true, 60, 0);
|
||||
|
||||
for (int y = 0; y < 3; ++y)
|
||||
{
|
||||
for (int x = 0; x < 3; ++x)
|
||||
{
|
||||
for (int y = 0; y < 3; ++y) {
|
||||
for (int x = 0; x < 3; ++x) {
|
||||
int index = INPUT_SLOT + x + (y * 3);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18 - 18);
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI)
|
||||
{
|
||||
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI) {
|
||||
guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
ingredients.getInputs(ItemStack.class).remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
|
|
|
@ -1,37 +1,32 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngradeRecipeJEI>
|
||||
{
|
||||
public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngradeRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ArmourDowngradeRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<ArmourDowngradeRecipeJEI> getRecipeClass() {
|
||||
return ArmourDowngradeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(ArmourDowngradeRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ArmourDowngradeRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull ArmourDowngradeRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper {
|
||||
private LivingArmourDowngradeRecipe recipe;
|
||||
|
||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
||||
{
|
||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.LivingArmourDowngradeRecipeRegistry;
|
||||
|
||||
public class ArmourDowngradeRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourDowngradeRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<ArmourDowngradeRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<ArmourDowngradeRecipeJEI> getRecipes() {
|
||||
List<LivingArmourDowngradeRecipe> recipeList = LivingArmourDowngradeRecipeRegistry.getRecipeList();
|
||||
ArrayList<ArmourDowngradeRecipeJEI> recipes = new ArrayList<ArmourDowngradeRecipeJEI>();
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -12,12 +12,11 @@ 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;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class BindingRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class BindingRecipeCategory implements IRecipeCategory {
|
||||
private static final int INPUT_SLOT = 0;
|
||||
private static final int CATALYST_SLOT = 1;
|
||||
private static final int OUTPUT_SLOT = 2;
|
||||
|
@ -29,28 +28,24 @@ public class BindingRecipeCategory implements IRecipeCategory
|
|||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -66,8 +61,7 @@ public class BindingRecipeCategory implements IRecipeCategory
|
|||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof BindingRecipeJEI)
|
||||
{
|
||||
if (recipeWrapper instanceof BindingRecipeJEI) {
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
|
|
|
@ -1,36 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
|
||||
{
|
||||
public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<BindingRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<BindingRecipeJEI> getRecipeClass() {
|
||||
return BindingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(@Nonnull BindingRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull BindingRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BindingRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
|
||||
public class BindingRecipeJEI extends BlankRecipeWrapper {
|
||||
@Nonnull
|
||||
private final List<ItemStack> inputs;
|
||||
|
||||
|
@ -21,8 +19,7 @@ public class BindingRecipeJEI extends BlankRecipeWrapper
|
|||
private final ItemStack output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BindingRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output)
|
||||
{
|
||||
public BindingRecipeJEI(@Nonnull List<ItemStack> input, @Nonnull ItemStack catalyst, @Nonnull ItemStack output) {
|
||||
this.inputs = input;
|
||||
this.catalyst = catalyst;
|
||||
this.output = output;
|
||||
|
|
|
@ -1,38 +1,31 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.alchemyArray.AlchemyArrayEffectBinding;
|
||||
import WayofTime.bloodmagic.api.ItemStackWrapper;
|
||||
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
|
||||
import WayofTime.bloodmagic.api.registry.AlchemyArrayRecipeRegistry;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BindingRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BindingRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<BindingRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<BindingRecipeJEI> getRecipes() {
|
||||
Map<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes();
|
||||
|
||||
ArrayList<BindingRecipeJEI> recipes = new ArrayList<BindingRecipeJEI>();
|
||||
|
||||
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<List<ItemStack>, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) {
|
||||
List<ItemStack> input = itemStackAlchemyArrayRecipeEntry.getValue().getInput();
|
||||
BiMap<ItemStackWrapper, AlchemyArrayEffect> catalystMap = itemStackAlchemyArrayRecipeEntry.getValue().catalystMap;
|
||||
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet())
|
||||
{
|
||||
for (Map.Entry<ItemStackWrapper, AlchemyArrayEffect> entry : catalystMap.entrySet()) {
|
||||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
|
||||
{
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding) {
|
||||
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||
|
||||
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
|
@ -16,12 +14,12 @@ 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;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeCategory implements IRecipeCategory {
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int GEM_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
@ -33,57 +31,48 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public TartaricForgeRecipeCategory()
|
||||
{
|
||||
public TartaricForgeRecipeCategory() {
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
public String getUid() {
|
||||
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
public String getTitle() {
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 73, 13);
|
||||
guiItemStacks.init(GEM_SLOT, true, 42, 0);
|
||||
|
||||
for (int y = 0; y < 3; ++y)
|
||||
{
|
||||
for (int x = 0; x < 3; ++x)
|
||||
{
|
||||
for (int y = 0; y < 3; ++y) {
|
||||
for (int x = 0; x < 3; ++x) {
|
||||
int index = INPUT_SLOT + x + (y * 3);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18);
|
||||
}
|
||||
|
@ -92,8 +81,7 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
|
||||
if (recipeWrapper instanceof TartaricForgeRecipeJEI)
|
||||
{
|
||||
if (recipeWrapper instanceof TartaricForgeRecipeJEI) {
|
||||
TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
|
|
|
@ -6,31 +6,26 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeRecipeJEI>
|
||||
{
|
||||
public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeRecipeJEI> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<TartaricForgeRecipeJEI> getRecipeClass()
|
||||
{
|
||||
public Class<TartaricForgeRecipeJEI> getRecipeClass() {
|
||||
return TartaricForgeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe)
|
||||
{
|
||||
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull TartaricForgeRecipeJEI recipe)
|
||||
{
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe)
|
||||
{
|
||||
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper {
|
||||
private TartaricForgeRecipe recipe;
|
||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
|
||||
{
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
|
||||
for (DefaultWill will : DefaultWill.values())
|
||||
|
@ -37,11 +34,9 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34)
|
||||
{
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34) {
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulsDrained()));
|
||||
return ret;
|
||||
|
@ -49,8 +44,15 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
return null;
|
||||
}
|
||||
|
||||
public enum DefaultWill
|
||||
{
|
||||
public TartaricForgeRecipe getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
public List<ItemStack> getValidGems() {
|
||||
return validGems;
|
||||
}
|
||||
|
||||
public enum DefaultWill {
|
||||
SOUL(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL, 1, 0), 64),
|
||||
PETTY(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 0), 64),
|
||||
LESSER(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1), 256),
|
||||
|
@ -61,18 +63,9 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
public final ItemStack willStack;
|
||||
public final double minSouls;
|
||||
|
||||
DefaultWill(ItemStack willStack, double minSouls)
|
||||
{
|
||||
DefaultWill(ItemStack willStack, double minSouls) {
|
||||
this.willStack = willStack;
|
||||
this.minSouls = minSouls;
|
||||
}
|
||||
}
|
||||
|
||||
public TartaricForgeRecipe getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
public List<ItemStack> getValidGems() {
|
||||
return validGems;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.TartaricForgeRecipeRegistry;
|
||||
|
||||
public class TartaricForgeRecipeMaker
|
||||
{
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TartaricForgeRecipeMaker {
|
||||
@Nonnull
|
||||
public static List<TartaricForgeRecipeJEI> getRecipes()
|
||||
{
|
||||
public static List<TartaricForgeRecipeJEI> getRecipes() {
|
||||
List<TartaricForgeRecipe> recipeList = TartaricForgeRecipeRegistry.getRecipeList();
|
||||
ArrayList<TartaricForgeRecipeJEI> recipes = new ArrayList<TartaricForgeRecipeJEI>();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue