Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-131599

Opening player inventory with visible recipe book after using beacon causes crash

XMLWordPrintable

    • Confirmed

      The bug

      First described in this reddit post

      Opening the player inventory showing the recipe book (crafting table and furnace apparently do not cause the bug) after using a beacon crashes the game.

      Description: Unexpected error
      
      java.lang.ClassCastException: atk cannot be cast to aue
      	at cor.a(SourceFile:39)
      	at cop.f(SourceFile:84)
      	at cop.a(SourceFile:73)
      	at coo.d(SourceFile:190)
      	at coo.a(SourceFile:114)
      	at coo.a(SourceFile:78)
      	at cnw.c(SourceFile:54)
      	at cmk.a(SourceFile:311)
      	at cit.a(SourceFile:725)
      	at cit.au(SourceFile:1334)
      	at cit.m(SourceFile:1216)
      	at cit.c(SourceFile:787)
      	at cit.a(SourceFile:379)
      	at net.minecraft.client.main.Main.main(SourceFile:144)
      

      How to reproduce

      1. Build a level 1 beacon
      2. Give yourself for example an iron ingot
      3. Switch to Survival
      4. Open your inventory and open the recipe book
      5. Close your inventory while the recipe book is open
      6. Open the beacon GUI, select an effect and use the iron ingot
      7. Close the beacon GUI
      8. Try to open your inventory
        The game crashes

      Partial code analysis

      It looks like the last method calls would be roughly (parameters and method bodies have changed slightly) the following in MCP 9.40:

      Stacktrace
      net.minecraft.client.gui.recipebook.GuiButtonRecipe.init(RecipeList, RecipeBookPage, RecipeBook)
      net.minecraft.client.gui.recipebook.RecipeBookPage.updateButtonsForPage()
      net.minecraft.client.gui.recipebook.RecipeBookPage.updateLists(List<RecipeList>, boolean)
      net.minecraft.client.gui.recipebook.GuiRecipeBook.updateCollections(boolean)
      net.minecraft.client.gui.recipebook.GuiRecipeBook.initVisuals(boolean, InventoryCrafting)
      net.minecraft.client.gui.recipebook.GuiRecipeBook.func_194303_a(int, int, Minecraft, boolean, InventoryCrafting)
      net.minecraft.client.gui.inventory.GuiInventory.initGui()
      
      cor.a (1.13-pre2)
      public void a(cos cos2, cop cop2) {
      	this.r = cos2;
      	this.p = (aue)cop2.d().g.bD;
      	this.q = cop2.e();
      	List<ayx> list = cos2.a(this.q.a(this.p));
      	for (ayx ayx2 : list) {
      		if (!this.q.d(ayx2)) continue;
      		cop2.a(list);
      		this.t = 15.0f;
      		break;
      	}
      }
      
      Obfuscated code (1.13-pre2) Deobfuscated
      cop2.d().g.bD net.minecraft.entity.player.EntityPlayer.openContainer
      atk ContainerBeacon

      This suggests that after closing the beacon GUI the container is not reset.

            cojomax99 [Mojang] Cory Scheviak
            marcono1234 Marcono1234
            Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: