mojira.dev
MC-120513

The advancements overview can be opened while being in a nether portal

The bug

Unlike all other GUIs, you can open the advancements overview while traveling to the nether or back.

In singleplayer, the game is paused then while in multiplayer, the game continues to run, causing the advancements overview to be closed as soon as you've changed the dimension.

How to reproduce

  1. Enter a portal

  2. Press the "Advancements overview" key (default: L)

Code analysis

In class EntityPlayerSP, in function onLivingUpdate, it is defined that a screen's doesGuiPauseGame function must return false if it should not be able to be shown.

If that function is implemented into GuiScreenAdvancements like so:

GuiScreenAdvancements.java

public boolean doesGuiPauseGame()
{
    return false;
}

the overview can not be invoked while the player is inside of a portal. However, this also causes the overview to disappear when you open it from the pause menu while standing inside of a portal; and also the game does not stop while being in the advancements overview, which probably is not intended.

Linked issues

Attachments

Comments 16

The code analysis and suggested fix is misleading in my opinion.

It is likely the case that you spent much time in the advancement GUI when you look through all the advancements and I assume you would appreciate to not be blown up by a sneaky creeper while doing that.

Whether or not a GUI can be used should either be determined by a different method or this report is invalid.

Since the game determines whether or not a GUI can be opened while standing inside of a nether portal by checking if the GUI pauses the game, this might be intended as the advancements GUI screen (intentionally) pauses the game. However, if this is not intended and the advancements GUI screen really is the only game-pausing GUI screen which shouldn't be possible to open inside of a nether portal, the simplest and least game-breaking fix IMO would be to add this exception to the if-statement in net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate().

net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate()

public void onLivingUpdate()
{
	// ...
	if (this.inPortal)
	{
		if (this.mc.currentScreen != null && (!this.mc.currentScreen.doesGuiPauseGame() || this.mc.currentScreen instanceof GuiScreenAdvancements))
		{
			this.mc.displayGuiScreen((GuiScreen)null);
		}

		// ...
	}
	// ...
}

Confirmed for 1.13.1.

Can confirm in 20w48a.

Can confirm in 20w51a.

6 more comments

Can confirm in 1.17.1.

Can confirm in 1.18.1.

Can confirm in 1.18.2.

Can confirm in 1.19.

Can confirm in 1.19.2.

[Mod] violine1101

(Unassigned)

Confirmed

UI

advancement, gui, menu, portal

Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w49a, ..., 1.19, 1.19.2, 1.19.4, 23w18a, 1.21

Retrieved