Update mappings

This commit is contained in:
Nicholas Ignoffo 2017-02-04 22:43:18 -08:00
parent 7b21439a03
commit 85a8a12a6f
185 changed files with 825 additions and 1273 deletions

View file

@ -1,14 +1,14 @@
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.IRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
@ -27,7 +27,7 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
@Nonnull
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
@Nonnull
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.alchemyTable");
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyTable");
@Nonnull
private final ICraftingGridHelper craftingGridHelper;
@ -63,15 +63,16 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
}
@Nullable
@Override
public void drawAnimations(Minecraft minecraft)
public IDrawable getIcon()
{
return null;
}
@Override
@SuppressWarnings("unchecked")
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
{
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -89,10 +90,19 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
if (recipeWrapper instanceof AlchemyTableRecipeJEI)
{
AlchemyTableRecipeJEI recipe = (AlchemyTableRecipeJEI) recipeWrapper;
guiItemStacks.set(ORB_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
guiItemStacks.set(ORB_SLOT, ingredients.getInputs(ItemStack.class).get(1));
craftingGridHelper.setOutput(guiItemStacks, Lists.newArrayList(ingredients.getOutputs(ItemStack.class).get(0)));
craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
}
}
@Override
public void drawAnimations(Minecraft minecraft) {
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
}
}

View file

@ -15,14 +15,6 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
return AlchemyTableRecipeJEI.class;
}
@Deprecated
@Nonnull
@Override
public String getRecipeCategoryUid()
{
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
}
@Override
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe)
{
@ -39,6 +31,11 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
@Override
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe)
{
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
return true;
}
@Override
public String getRecipeCategoryUid() {
return null;
}
}

View file

@ -1,18 +1,14 @@
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
import lombok.Getter;
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.api.registry.OrbRegistry;
import WayofTime.bloodmagic.util.helper.TextHelper;
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
@ -20,42 +16,27 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
@Getter
private AlchemyTableRecipe recipe;
// @Getter
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
{
this.recipe = recipe;
}
@Override
@Nonnull
public List<Collection> getInputs()
{
ArrayList<Collection> ret = new ArrayList<Collection>();
ret.add(recipe.getInput());
ret.add(OrbRegistry.getOrbsDownToTier(recipe.getTierRequired()));
return ret;
public void getIngredients(IIngredients ingredients) {
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
ingredients.setInputLists(ItemStack.class, expanded);
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(new ArrayList<ItemStack>()));
}
@Override
@Nonnull
public List<ItemStack> getOutputs()
{
return Collections.singletonList(recipe.getRecipeOutput(new ArrayList<ItemStack>()));
}
@Nullable
@Override
public List<String> getTooltipStrings(int mouseX, int mouseY)
{
ArrayList<String> ret = new ArrayList<String>();
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
{
ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
return ret;
ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getLpDrained()));
ret.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicksRequired()));
}
return null;
return ret;
}
}

View file

@ -1,7 +0,0 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.compat.jei.alchemyTable;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;