Update JEI and add some new features like seeing the items the recipe works with at the top

This commit is contained in:
Ellpeck 2016-05-06 14:50:15 +02:00
parent 3f4f87f273
commit 1c0fb786b2
2 changed files with 25 additions and 7 deletions

View file

@ -42,7 +42,7 @@ dependencies {
//compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev" //compile "codechicken:CodeChickenCore:1.8-1.0.5.36:dev"
//compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev" //compile "codechicken:NotEnoughItems:1.8-1.0.5.104:dev"
deobfCompile "mezz.jei:jei_1.9:3.2.11.186" deobfCompile "mezz.jei:jei_1.9:3.3.3.197"
} }
processResources { processResources {

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.jei;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiGrinder;
@ -24,10 +25,14 @@ import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherRecipeHandler;
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeCategory;
import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler; import de.ellpeck.actuallyadditions.mod.jei.reconstructor.ReconstructorRecipeHandler;
import de.ellpeck.actuallyadditions.mod.nei.NEIBookletRecipe;
import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe; import de.ellpeck.actuallyadditions.mod.nei.NEICoffeeMachineRecipe;
import de.ellpeck.actuallyadditions.mod.nei.NEIReconstructorRecipe;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import mezz.jei.api.*; import mezz.jei.api.*;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid; import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import mezz.jei.api.recipe.transfer.IRecipeTransferRegistry;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@JEIPlugin @JEIPlugin
@ -35,11 +40,13 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
@Override @Override
public void register(IModRegistry registry){ public void register(IModRegistry registry){
IJeiHelpers helpers = registry.getJeiHelpers();
registry.addRecipeCategories( registry.addRecipeCategories(
new BookletRecipeCategory(registry.getJeiHelpers().getGuiHelper()), new BookletRecipeCategory(helpers.getGuiHelper()),
new CoffeeMachineRecipeCategory(registry.getJeiHelpers().getGuiHelper()), new CoffeeMachineRecipeCategory(helpers.getGuiHelper()),
new CrusherRecipeCategory(registry.getJeiHelpers().getGuiHelper()), new CrusherRecipeCategory(helpers.getGuiHelper()),
new ReconstructorRecipeCategory(registry.getJeiHelpers().getGuiHelper()) new ReconstructorRecipeCategory(helpers.getGuiHelper())
); );
registry.addRecipeHandlers( registry.addRecipeHandlers(
@ -59,7 +66,7 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME); registry.addRecipeClickArea(GuiGrinder.GuiGrinderDouble.class, 51, 40, 74, 22, CrusherRecipeCategory.NAME);
registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING); registry.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, VanillaRecipeCategoryUid.SMELTING);
INbtIgnoreList ignoreList = registry.getJeiHelpers().getNbtIgnoreList(); INbtIgnoreList ignoreList = helpers.getNbtIgnoreList();
ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemDrill, "Energy");
ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemTeleStaff, "Energy");
ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemGrowthRing, "Energy");
@ -71,13 +78,24 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin{
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuadruple, "Energy");
ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy"); ignoreList.ignoreNbtTagNames(InitItems.itemBatteryQuintuple, "Energy");
IItemBlacklist blacklist = registry.getJeiHelpers().getItemBlacklist(); IItemBlacklist blacklist = helpers.getItemBlacklist();
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockRice));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCanola));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockFlax));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockCoffee));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockWildPlant, 1, Util.WILDCARD));
blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD)); blacklist.addItemToBlacklist(new ItemStack(InitBlocks.blockColoredLampOn, 1, Util.WILDCARD));
IRecipeTransferRegistry transfer = registry.getRecipeTransferRegistry();
transfer.addRecipeTransferHandler(ContainerCrafter.class, VanillaRecipeCategoryUid.CRAFTING, 1, 9, 10, 36);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemCrafterOnAStick), VanillaRecipeCategoryUid.CRAFTING);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockFurnaceDouble), VanillaRecipeCategoryUid.SMELTING);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinder), CrusherRecipeCategory.NAME);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockGrinderDouble), CrusherRecipeCategory.NAME);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockCoffeeMachine), NEICoffeeMachineRecipe.NAME);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitBlocks.blockAtomicReconstructor), NEIReconstructorRecipe.NAME);
registry.addRecipeCategoryCraftingItem(new ItemStack(InitItems.itemBooklet), NEIBookletRecipe.NAME);
} }
@Override @Override