diff --git a/gradle.properties b/gradle.properties index f5c4f859c..91dd221e7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ curse_project_id=238222 version_major=4 version_minor=14 -version_patch=2 +version_patch=3 diff --git a/src/main/java/mezz/jei/collect/Table.java b/src/main/java/mezz/jei/collect/Table.java index 4aa134694..7591621c2 100644 --- a/src/main/java/mezz/jei/collect/Table.java +++ b/src/main/java/mezz/jei/collect/Table.java @@ -42,6 +42,10 @@ public Map getRow(R row) { return table.computeIfAbsent(row, rowMappingFunction); } + public void clear() { + table.clear(); + } + public ImmutableTable toImmutable() { ImmutableTable.Builder builder = ImmutableTable.builder(); for (Map.Entry> entry : table.entrySet()) { diff --git a/src/main/java/mezz/jei/gui/recipes/RecipeGuiLogic.java b/src/main/java/mezz/jei/gui/recipes/RecipeGuiLogic.java index 8056c833b..05fc8b4ce 100644 --- a/src/main/java/mezz/jei/gui/recipes/RecipeGuiLogic.java +++ b/src/main/java/mezz/jei/gui/recipes/RecipeGuiLogic.java @@ -7,12 +7,14 @@ import com.google.common.collect.ImmutableList; import mezz.jei.api.IRecipeRegistry; +import mezz.jei.api.ingredients.IIngredientHelper; import mezz.jei.api.recipe.IFocus; import mezz.jei.api.recipe.IRecipeCategory; import mezz.jei.api.recipe.IRecipeWrapper; import mezz.jei.api.recipe.transfer.IRecipeTransferHandler; import mezz.jei.gui.Focus; import mezz.jei.gui.ingredients.IngredientLookupState; +import mezz.jei.ingredients.IngredientRegistry; import mezz.jei.util.MathUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -23,6 +25,7 @@ public class RecipeGuiLogic implements IRecipeGuiLogic { private final IRecipeRegistry recipeRegistry; private final IRecipeLogicStateListener stateListener; + private final IngredientRegistry ingredientRegistry; private boolean initialState = true; private IngredientLookupState state; @@ -33,9 +36,10 @@ public class RecipeGuiLogic implements IRecipeGuiLogic { */ private List recipes = Collections.emptyList(); - public RecipeGuiLogic(IRecipeRegistry recipeRegistry, IRecipeLogicStateListener stateListener) { + public RecipeGuiLogic(IRecipeRegistry recipeRegistry, IRecipeLogicStateListener stateListener, IngredientRegistry ingredientRegistry) { this.recipeRegistry = recipeRegistry; this.stateListener = stateListener; + this.ingredientRegistry = ingredientRegistry; List recipeCategories = recipeRegistry.getRecipeCategories(); this.state = new IngredientLookupState(null, recipeCategories, 0, 0); } @@ -43,7 +47,10 @@ public RecipeGuiLogic(IRecipeRegistry recipeRegistry, IRecipeLogicStateListener @Override public boolean setFocus(IFocus focus) { focus = Focus.check(focus); - final List recipeCategories = recipeRegistry.getRecipeCategories(focus); + IIngredientHelper ingredientHelper = ingredientRegistry.getIngredientHelper(focus.getValue()); + IFocus translatedFocus = ingredientHelper.translateFocus(focus, Focus::new); + + final List recipeCategories = recipeRegistry.getRecipeCategories(translatedFocus); if (recipeCategories.isEmpty()) { return false; } @@ -53,7 +60,7 @@ public boolean setFocus(IFocus focus) { } int recipeCategoryIndex = getRecipeCategoryIndexToShowFirst(recipeCategories); - IngredientLookupState state = new IngredientLookupState(focus, recipeCategories, recipeCategoryIndex, 0); + IngredientLookupState state = new IngredientLookupState(translatedFocus, recipeCategories, recipeCategoryIndex, 0); setState(state); return true; diff --git a/src/main/java/mezz/jei/gui/recipes/RecipesGui.java b/src/main/java/mezz/jei/gui/recipes/RecipesGui.java index 67b29b87f..63f6d1df2 100644 --- a/src/main/java/mezz/jei/gui/recipes/RecipesGui.java +++ b/src/main/java/mezz/jei/gui/recipes/RecipesGui.java @@ -17,6 +17,7 @@ import mezz.jei.gui.elements.GuiIconButtonSmall; import mezz.jei.gui.ingredients.GuiIngredient; import mezz.jei.gui.overlay.IngredientListOverlay; +import mezz.jei.ingredients.IngredientRegistry; import mezz.jei.input.ClickedIngredient; import mezz.jei.input.IClickedIngredient; import mezz.jei.input.IShowsRecipeFocuses; @@ -81,8 +82,8 @@ public class RecipesGui extends GuiScreen implements IRecipesGui, IShowsRecipeFo private boolean init = false; - public RecipesGui(IRecipeRegistry recipeRegistry) { - this.logic = new RecipeGuiLogic(recipeRegistry, this); + public RecipesGui(IRecipeRegistry recipeRegistry, IngredientRegistry ingredientRegistry) { + this.logic = new RecipeGuiLogic(recipeRegistry, this, ingredientRegistry); this.recipeCatalysts = new RecipeCatalysts(); this.recipeGuiTabs = new RecipeGuiTabs(this.logic); this.mc = Minecraft.getMinecraft(); diff --git a/src/main/java/mezz/jei/plugins/jei/ingredients/DebugIngredientHelper.java b/src/main/java/mezz/jei/plugins/jei/ingredients/DebugIngredientHelper.java index 63911abf1..d9d624fab 100644 --- a/src/main/java/mezz/jei/plugins/jei/ingredients/DebugIngredientHelper.java +++ b/src/main/java/mezz/jei/plugins/jei/ingredients/DebugIngredientHelper.java @@ -3,7 +3,6 @@ import javax.annotation.Nullable; import java.awt.Color; import java.util.Collections; -import java.util.List; import mezz.jei.api.ingredients.IIngredientHelper; import mezz.jei.config.Constants; diff --git a/src/main/java/mezz/jei/plugins/vanilla/VanillaPlugin.java b/src/main/java/mezz/jei/plugins/vanilla/VanillaPlugin.java index 697c7c84f..eeb8151e2 100644 --- a/src/main/java/mezz/jei/plugins/vanilla/VanillaPlugin.java +++ b/src/main/java/mezz/jei/plugins/vanilla/VanillaPlugin.java @@ -31,6 +31,10 @@ import mezz.jei.plugins.vanilla.furnace.FurnaceFuelCategory; import mezz.jei.plugins.vanilla.furnace.FurnaceSmeltingCategory; import mezz.jei.plugins.vanilla.furnace.SmeltingRecipeMaker; +import mezz.jei.plugins.vanilla.ingredients.enchant.EnchantDataHelper; +import mezz.jei.plugins.vanilla.ingredients.enchant.EnchantDataListFactory; +import mezz.jei.plugins.vanilla.ingredients.enchant.EnchantDataRenderer; +import mezz.jei.plugins.vanilla.ingredients.enchant.EnchantedBookCache; import mezz.jei.plugins.vanilla.ingredients.fluid.FluidStackHelper; import mezz.jei.plugins.vanilla.ingredients.fluid.FluidStackListFactory; import mezz.jei.plugins.vanilla.ingredients.fluid.FluidStackRenderer; @@ -45,6 +49,7 @@ import net.minecraft.client.gui.inventory.GuiFurnace; import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerBrewingStand; @@ -62,7 +67,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; @@ -126,6 +133,13 @@ public void registerIngredients(IModIngredientRegistration ingredientRegistratio FluidStackHelper fluidStackHelper = new FluidStackHelper(); FluidStackRenderer fluidStackRenderer = new FluidStackRenderer(); ingredientRegistration.register(VanillaTypes.FLUID, fluidStacks, fluidStackHelper, fluidStackRenderer); + + List enchantments = EnchantDataListFactory.create(); + EnchantedBookCache enchantedBookCache = new EnchantedBookCache(); + MinecraftForge.EVENT_BUS.register(enchantedBookCache); + EnchantDataHelper enchantmentHelper = new EnchantDataHelper(enchantedBookCache, itemStackHelper); + EnchantDataRenderer enchantmentRenderer = new EnchantDataRenderer(itemStackRenderer, enchantedBookCache); + ingredientRegistration.register(() -> EnchantmentData.class, enchantments, enchantmentHelper, enchantmentRenderer); } @Override @@ -182,5 +196,7 @@ public void register(IModRegistry registry) { IIngredientBlacklist ingredientBlacklist = registry.getJeiHelpers().getIngredientBlacklist(); // Game freezes when loading player skulls, see https://bugs.mojang.com/browse/MC-65587 ingredientBlacklist.addIngredientToBlacklist(new ItemStack(Items.SKULL, 1, 3)); + // hide enchanted books, we display them as special ingredients because vanilla does not properly store the enchantment data by its registry name + ingredientBlacklist.addIngredientToBlacklist(new ItemStack(Items.ENCHANTED_BOOK, 1, OreDictionary.WILDCARD_VALUE)); } } diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataHelper.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataHelper.java new file mode 100644 index 000000000..574add1cd --- /dev/null +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataHelper.java @@ -0,0 +1,116 @@ +package mezz.jei.plugins.vanilla.ingredients.enchant; + +import javax.annotation.Nullable; +import java.awt.Color; + +import com.google.common.base.MoreObjects; +import mezz.jei.api.ingredients.IIngredientHelper; +import mezz.jei.api.recipe.IFocus; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +public class EnchantDataHelper implements IIngredientHelper { + private final EnchantedBookCache cache; + private final IIngredientHelper itemStackHelper; + + public EnchantDataHelper(EnchantedBookCache cache, IIngredientHelper itemStackHelper) { + this.cache = cache; + this.itemStackHelper = itemStackHelper; + } + + @Override + @Nullable + public EnchantmentData getMatch(Iterable ingredients, EnchantmentData toMatch) { + for (EnchantmentData enchantData : ingredients) { + if (enchantData.enchantment.getRegistryName() == toMatch.enchantment.getRegistryName() + && enchantData.enchantmentLevel == toMatch.enchantmentLevel) { + return enchantData; + } + } + return null; + } + + @Override + public IFocus translateFocus(IFocus focus, IFocusFactory focusFactory) { + EnchantmentData enchantData = focus.getValue(); + ItemStack itemStack = cache.getEnchantedBook(enchantData); + return focusFactory.createFocus(focus.getMode(), itemStack); + } + + @Override + public String getDisplayName(EnchantmentData ingredient) { + return ingredient.enchantment.getTranslatedName(ingredient.enchantmentLevel); + } + + @Override + public String getUniqueId(EnchantmentData ingredient) { + return "enchantment:" + ingredient.enchantment.getName() + ".lvl" + ingredient.enchantmentLevel; + } + + @Override + public String getWildcardId(EnchantmentData ingredient) { + return getUniqueId(ingredient); + } + + @Override + public String getModId(EnchantmentData ingredient) { + ResourceLocation registryName = ingredient.enchantment.getRegistryName(); + if (registryName == null) { + String stackInfo = getErrorInfo(ingredient); + throw new IllegalStateException("enchantment.getRegistryName() returned null for: " + stackInfo); + } + return registryName.getNamespace(); + } + + @Override + public String getDisplayModId(EnchantmentData ingredient) { + ItemStack enchantedBook = cache.getEnchantedBook(ingredient); + return this.itemStackHelper.getDisplayModId(enchantedBook); + } + + @Override + public Iterable getColors(EnchantmentData ingredient) { + ItemStack enchantedBook = cache.getEnchantedBook(ingredient); + return this.itemStackHelper.getColors(enchantedBook); + } + + @Override + public String getResourceId(EnchantmentData ingredient) { + ResourceLocation registryName = ingredient.enchantment.getRegistryName(); + if (registryName == null) { + String stackInfo = getErrorInfo(ingredient); + throw new IllegalStateException("enchantment.getRegistryName() returned null for: " + stackInfo); + } + return registryName.getPath(); + } + + @Override + public ItemStack getCheatItemStack(EnchantmentData ingredient) { + return cache.getEnchantedBook(ingredient); + } + + @Override + public EnchantmentData copyIngredient(EnchantmentData ingredient) { + return new EnchantmentData(ingredient.enchantment, ingredient.enchantmentLevel); + } + + @Override + public boolean isIngredientOnServer(EnchantmentData ingredient) { + ItemStack enchantedBook = cache.getEnchantedBook(ingredient); + return this.itemStackHelper.isIngredientOnServer(enchantedBook); + } + + @Override + public String getErrorInfo(@Nullable EnchantmentData ingredient) { + if (ingredient == null) { + return "null"; + } + MoreObjects.ToStringHelper toStringHelper = MoreObjects.toStringHelper(EnchantmentData.class); + + toStringHelper.add("Enchantment", ingredient.enchantment.getName()); + toStringHelper.add("Level", ingredient.enchantmentLevel); + + return toStringHelper.toString(); + } +} diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataListFactory.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataListFactory.java new file mode 100644 index 000000000..7d3bcf4e4 --- /dev/null +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataListFactory.java @@ -0,0 +1,28 @@ +package mezz.jei.plugins.vanilla.ingredients.enchant; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraftforge.fml.common.registry.ForgeRegistries; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; + +public final class EnchantDataListFactory { + private EnchantDataListFactory() { + + } + + public static List create() { + List enchantData = new ArrayList<>(); + + Collection enchants = ForgeRegistries.ENCHANTMENTS.getValuesCollection(); + for (Enchantment enchant : enchants) { + for (int lvl = enchant.getMinLevel(); lvl <= enchant.getMaxLevel(); lvl++) { + enchantData.add(new EnchantmentData(enchant, lvl)); + } + } + + return enchantData; + } +} diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataRenderer.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataRenderer.java new file mode 100644 index 000000000..36544c15a --- /dev/null +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantDataRenderer.java @@ -0,0 +1,42 @@ +package mezz.jei.plugins.vanilla.ingredients.enchant; + +import mezz.jei.api.ingredients.IIngredientRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.item.ItemStack; + +import javax.annotation.Nullable; +import java.util.List; + +public class EnchantDataRenderer implements IIngredientRenderer { + + private IIngredientRenderer itemRenderer; + private EnchantedBookCache cache; + + public EnchantDataRenderer(IIngredientRenderer itemRenderer, EnchantedBookCache cache) { + this.itemRenderer = itemRenderer; + this.cache = cache; + } + + @Override + public void render(Minecraft minecraft, int xPosition, int yPosition, @Nullable EnchantmentData ingredient) { + if (ingredient != null) { + ItemStack enchantBook = cache.getEnchantedBook(ingredient); + itemRenderer.render(minecraft, xPosition, yPosition, enchantBook); + } + } + + @Override + public List getTooltip(Minecraft minecraft, EnchantmentData ingredient, ITooltipFlag tooltipFlag) { + ItemStack enchantBook = cache.getEnchantedBook(ingredient); + return itemRenderer.getTooltip(minecraft, enchantBook, tooltipFlag); + } + + @Override + public FontRenderer getFontRenderer(Minecraft minecraft, EnchantmentData ingredient) { + ItemStack enchantBook = cache.getEnchantedBook(ingredient); + return itemRenderer.getFontRenderer(minecraft, enchantBook); + } +} diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantedBookCache.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantedBookCache.java new file mode 100644 index 000000000..25526bbab --- /dev/null +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/EnchantedBookCache.java @@ -0,0 +1,28 @@ +package mezz.jei.plugins.vanilla.ingredients.enchant; + +import mezz.jei.collect.Table; +import mezz.jei.startup.PlayerJoinedWorldEvent; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.item.ItemEnchantedBook; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class EnchantedBookCache { + private final Table cache = Table.hashBasedTable(); + + public ItemStack getEnchantedBook(EnchantmentData enchantmentData) { + Enchantment enchantment = enchantmentData.enchantment; + ResourceLocation registryName = enchantment.getRegistryName(); + if (registryName == null) { + throw new IllegalArgumentException("Enchantment has no registry name: " + enchantment.getName()); + } + return cache.computeIfAbsent(registryName, enchantmentData.enchantmentLevel, () -> ItemEnchantedBook.getEnchantedItemStack(enchantmentData)); + } + + @SubscribeEvent + public void onPlayerJoinedWorldEvent(PlayerJoinedWorldEvent event) { + cache.clear(); + } +} diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/package-info.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/package-info.java new file mode 100644 index 000000000..de5b7d508 --- /dev/null +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/enchant/package-info.java @@ -0,0 +1,9 @@ +@ParametersAreNonnullByDefault +@FieldsAreNonnullByDefault +@MethodsReturnNonnullByDefault +package mezz.jei.plugins.vanilla.ingredients.enchant; + +import mcp.MethodsReturnNonnullByDefault; +import mezz.jei.util.FieldsAreNonnullByDefault; + +import javax.annotation.ParametersAreNonnullByDefault; \ No newline at end of file diff --git a/src/main/java/mezz/jei/plugins/vanilla/ingredients/fluid/FluidStackHelper.java b/src/main/java/mezz/jei/plugins/vanilla/ingredients/fluid/FluidStackHelper.java index b66e95fa3..14b021e6d 100644 --- a/src/main/java/mezz/jei/plugins/vanilla/ingredients/fluid/FluidStackHelper.java +++ b/src/main/java/mezz/jei/plugins/vanilla/ingredients/fluid/FluidStackHelper.java @@ -3,7 +3,6 @@ import javax.annotation.Nullable; import java.awt.Color; import java.util.Collections; -import java.util.List; import com.google.common.base.MoreObjects; import mezz.jei.api.ingredients.IIngredientHelper; diff --git a/src/main/java/mezz/jei/recipes/RecipeRegistry.java b/src/main/java/mezz/jei/recipes/RecipeRegistry.java index 74c205b77..5ef089a29 100644 --- a/src/main/java/mezz/jei/recipes/RecipeRegistry.java +++ b/src/main/java/mezz/jei/recipes/RecipeRegistry.java @@ -538,19 +538,15 @@ public RecipeClickableArea getRecipeClickableArea(GuiContainer gui, int mouseX, public List getRecipeCategories(IFocus focus) { focus = Focus.check(focus); - IIngredientHelper ingredientHelper = ingredientRegistry.getIngredientHelper(focus.getValue()); - IFocus translatedFocus = ingredientHelper.translateFocus(focus, this::createFocus); - translatedFocus = Focus.check(translatedFocus); - List allRecipeCategoryUids = new ArrayList<>(); for (IRecipeRegistryPlugin plugin : this.plugins) { - List recipeCategoryUids = plugin.getRecipeCategoryUids(translatedFocus); + List recipeCategoryUids = plugin.getRecipeCategoryUids(focus); for (String recipeCategoryUid : recipeCategoryUids) { if (!allRecipeCategoryUids.contains(recipeCategoryUid)) { if (hiddenRecipes.containsKey(recipeCategoryUid)) { IRecipeCategory recipeCategory = getRecipeCategory(recipeCategoryUid); if (recipeCategory != null) { - List recipeWrappers = getRecipeWrappers(recipeCategory, translatedFocus); + List recipeWrappers = getRecipeWrappers(recipeCategory, focus); if (!recipeWrappers.isEmpty()) { allRecipeCategoryUids.add(recipeCategoryUid); } @@ -570,13 +566,9 @@ public List getRecipeWrappers(IRecipeCategory ingredientHelper = ingredientRegistry.getIngredientHelper(focus.getValue()); - IFocus translatedFocus = ingredientHelper.translateFocus(focus, this::createFocus); - translatedFocus = Focus.check(translatedFocus); - List allRecipeWrappers = new ArrayList<>(); for (IRecipeRegistryPlugin plugin : this.plugins) { - List recipeWrappers = plugin.getRecipeWrappers(recipeCategory, translatedFocus); + List recipeWrappers = plugin.getRecipeWrappers(recipeCategory, focus); allRecipeWrappers.addAll(recipeWrappers); } diff --git a/src/main/java/mezz/jei/startup/ForgeModIdHelper.java b/src/main/java/mezz/jei/startup/ForgeModIdHelper.java index e024727a0..00f9ecfe1 100644 --- a/src/main/java/mezz/jei/startup/ForgeModIdHelper.java +++ b/src/main/java/mezz/jei/startup/ForgeModIdHelper.java @@ -12,6 +12,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.enchantment.EnchantmentData; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; @@ -107,7 +108,8 @@ public List addModNameToIngredientTooltip(List tooltip, T in tooltip.add(TextFormatting.GRAY + "info: " + ingredientHelper.getErrorInfo(ingredient)); tooltip.add(TextFormatting.GRAY + "uid: " + ingredientHelper.getUniqueId(ingredient)); } - if (Config.isModNameFormatOverrideActive() && ingredient instanceof ItemStack) { // we detected that another mod is adding the mod name already + if (Config.isModNameFormatOverrideActive() && (ingredient instanceof ItemStack || ingredient instanceof EnchantmentData)) { + // we detected that another mod is adding the mod name already return tooltip; } return super.addModNameToIngredientTooltip(tooltip, ingredient, ingredientHelper); diff --git a/src/main/java/mezz/jei/startup/JeiStarter.java b/src/main/java/mezz/jei/startup/JeiStarter.java index b2fdb7980..5a0ca4514 100644 --- a/src/main/java/mezz/jei/startup/JeiStarter.java +++ b/src/main/java/mezz/jei/startup/JeiStarter.java @@ -97,7 +97,7 @@ public void start(List plugins) { IngredientListOverlay ingredientListOverlay = new IngredientListOverlay(ingredientFilter, ingredientRegistry, guiScreenHelper); BookmarkOverlay bookmarkOverlay = new BookmarkOverlay(bookmarkList, jeiHelpers.getGuiHelper(), guiScreenHelper); - RecipesGui recipesGui = new RecipesGui(recipeRegistry); + RecipesGui recipesGui = new RecipesGui(recipeRegistry, ingredientRegistry); JeiRuntime jeiRuntime = new JeiRuntime(recipeRegistry, ingredientListOverlay, recipesGui, ingredientFilter); Internal.setRuntime(jeiRuntime); timer.stop(); diff --git a/src/test/java/mezz/jei/test/lib/TestIngredientHelper.java b/src/test/java/mezz/jei/test/lib/TestIngredientHelper.java index 18f24325a..0c378f01a 100644 --- a/src/test/java/mezz/jei/test/lib/TestIngredientHelper.java +++ b/src/test/java/mezz/jei/test/lib/TestIngredientHelper.java @@ -5,7 +5,6 @@ import javax.annotation.Nullable; import java.awt.Color; import java.util.Collections; -import java.util.List; public class TestIngredientHelper implements IIngredientHelper { @Nullable