mojira.dev
MC-131599

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

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.

[^(1.13-pre2) crash-2018-06-18_01.21.34-client.txt]

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.

Linked issues

Attachments

Comments 3

Note that you need to actually use an ingot/change an effect in the beacon; simply opening it will not cause the crash.

This crash happens if you [X] out of the beacon too, you do not have to add/change the effect.

Hm, perhaps instead an effect needs to have been already entered in it, then? It didn't work with a blank beacon for me.

marcono1234

coschevi

Confirmed

beacon, recipe-book

Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4

Minecraft 1.13-pre5

Retrieved