way2muchnoise / JustEnoughResources

A rewrite of NotEnoughResources using JustEnoughItems
Other
127 stars 65 forks source link

[1.12.2] JER Villagers tab malfunction bug #423

Open Krutoy242 opened 1 year ago

Krutoy242 commented 1 year ago

Opening Villagers tab caused error spam and malfunction of tab itself.

How to reproduce:

  1. Install only JEI + JER 0.9.3.203
  2. Run game
  3. Open JEI tab with villagers
  4. See how total numbers of pages in this trade becomes less and less
  5. After some scrolling, only 2 bugged trades left

https://github.com/CleanroomMC/HadEnoughItems/assets/936618/cf12b4ee-83cc-463a-bb3a-8a94fa864617

[Client thread/ERROR] [HadEnoughItems]: Error caught from Recipe Category: jeresources.jei.villager.VillagerCategory
java.lang.IndexOutOfBoundsException: Index: 4, Size: 4
    at java.util.LinkedList.checkElementIndex(LinkedList.java:555) ~[?:1.8.0_352]
    at java.util.LinkedList.get(LinkedList.java:476) ~[?:1.8.0_352]
    at jeresources.entry.VillagerEntry.getVillagerTrades(VillagerEntry.java:37) ~[VillagerEntry.class:?]
    at jeresources.jei.villager.VillagerWrapper.getTrades(VillagerWrapper.java:35) ~[VillagerWrapper.class:?]
    at jeresources.jei.villager.VillagerCategory.setRecipe(VillagerCategory.java:58) ~[VillagerCategory.class:?]
    at jeresources.jei.villager.VillagerCategory.setRecipe(VillagerCategory.java:16) ~[VillagerCategory.class:?]
    at mezz.jei.gui.recipes.RecipeLayout.create(RecipeLayout.java:69) [RecipeLayout.class:?]
    at mezz.jei.gui.recipes.RecipeGuiLogic.getRecipeLayouts(RecipeGuiLogic.java:198) [RecipeGuiLogic.class:?]
    at mezz.jei.gui.recipes.RecipesGui.updateLayout(RecipesGui.java:492) [RecipesGui.class:?]
    at mezz.jei.gui.recipes.RecipesGui.onStateChange(RecipesGui.java:538) [RecipesGui.class:?]
    at mezz.jei.gui.recipes.RecipeGuiLogic.nextPage(RecipeGuiLogic.java:254) [RecipeGuiLogic.class:?]
    at mezz.jei.gui.recipes.RecipesGui.func_146284_a(RecipesGui.java:438) [RecipesGui.class:?]
    at net.minecraft.client.gui.GuiScreen.func_73864_a(GuiScreen.java:443) [blk.class:?]
    at mezz.jei.gui.recipes.RecipesGui.func_73864_a(RecipesGui.java:336) [RecipesGui.class:?]
    at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533) [blk.class:?]
    at mezz.jei.gui.recipes.RecipesGui.func_146274_d(RecipesGui.java:304) [RecipesGui.class:?]
    at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501) [blk.class:?]

debug.log

Krutoy242 commented 8 months ago

Issue is still actual and fix is appreciated!