mojira.dev
MC-96521

After clicking "Delete World", hardcore world still runs in background

The bug

While testing MC-30646 "Hardcore game is not deleted" I found what may be another manifestation of the same bug, or maybe a new bug (perhaps related to MC-526 "Worlds will not delete").

Not only does a hardcore world not delete with the hardcore death screen deletion button (MC-30646), but additionally the world continues to run behind the UI. You get dropped to the title screen, but can hear the game sounds and music. You can also see the world still running on a second deletion confirmation screen. And even after the apparently successful second deletion action, the world is still not deleted.

How to reproduce

  1. Create singleplayer hardcore world

  2. Die in your hardcore world

  3. Choose "Delete world" on the death screen (not "Spectate world")

  4. Get dropped back to title screen
    → Notice the game sounds continue, as if your world is still running

  5. Choose singleplayer and view list of worlds
    → Observe that the hardcore world is not deleted, as per MC-30646

  6. Highlight hardcore world and choose delete

  7. On confirmation screen ("forever is a long time!"), confirm deletion
    → Notice that you can see your world still running in the background here, as well as hear it. Instead of the expected dirt texture background

  8. Get dropped back to singleplayer world list
    → Observe that hardcore world is not on the list, indicating (apparently) that it was deleted successfully.

  9. Hit escape (don't click the cancel button with mouse cursor)

Expected result

Go to title screen. Hardcore world remains deleted.

Actual result

Get kicked back into your hardcore world, facing once again the choice to delete or spectate. The first time I arrived here, I chose to spectate and my world was full of chunks that wouldn't load, and the game crashed with a memory overflow shortly, indicating maybe some part of the deletion was successful. On subsequent attempts, spectator mode worked fine, with no crashes, in the supposedly deleted world. Hitting delete at this screen will repeat the loop without deleting the world.
Note that hitting the escape key on the world select screen should probably behave the same as clicking the cancel button. That they behave differently may be another bug.

Note

Code analysis can be found in this comment

Related issues

MC-79128 client never disconects from hardcore server after dying, chat shown in single player MC-98939 Hardcore world still runs in background after hitting "Delete world" after dying MC-100687 Hardcore Death / World Deletion Bug MC-133507 Hardcore Death Haunts Players MC-135287 Hardcore deleted world effects the next worlds time MC-136401 Hardcore "Delete world" button breaks other worlds MC-153451 Hardcore "Delete World" audio bug. MC-153453 Hardcore Mode "Delete World" freeze bug MC-155599 After losing a Hardcore Game, can not create new World. MC-158303 Crashes the game if you ALT TAB MC-161415 Hardcore death causes black screen while trying to create a new world MC-162477 Hardcore World Bug MC-164324 Game Softlocking and effectively freezing upon death in hardcore mode MC-164484 Game crashes when a hardcore world is deleted REALMS-2311 Hardcore hearts in realms

Attachments

Comments

migrated
[media][media][media][media]
migrated

Can confirm.

EDIT: Apparently, after the world is "Deleted", the area that you died in said world shows up in various menus.

ziggurism

Confirmed for 16w05b.

ziggurism

Confirmed 16w07a.

kumasasa

@unknown, since you're the reporter of this ticket, you can update the affected versions list by yourself (and you don't need to leave a comment "Confirmed XXYY")

ziggurism

Thanks for pointing that out, Kumasasa. I'm kinda slow. But I've updated it to show 1.9-pre1 now.

migrated

I accidentally made a dupe of this in MC-98939. It appears that the world is still loaded in memory and running and so you can't completely delete it until you exit out of minecraft.

migrated

Confirmed for 1.13.1.

migrated

I seem to have found the source of the issue.

To sum it up, inside of GuiGameOver.java when the game checks if the world was in hardcore, it only changes the GuiScreen to the Main Menu without sending the normal disconnect packet.


Specifically in the actionPreformed function of GuiGameOver.java the if statement

 

if (this.mc.world.getWorldInfo().isHardcoreModeEnabled()) {
    this.mc.displayGuiScreen(new GuiMainMenu());
}

should more closely mirror the functionality of the confirmClicked function (where result is a boolean that is true if the player clicked "Title Screen" after dying).

 

if (result) {
    if (this.mc.world != null) {
        this.mc.world.sendQuittingDisconnectingPacket();
    }

    this.mc.loadWorld((WorldClient)null);
    this.mc.displayGuiScreen(new GuiMainMenu());
}

The fixed code is the following (for actionPerformed in GuiGameOver.java ~line 75)

 

if (this.mc.world.getWorldInfo().isHardcoreModeEnabled()) {
    //Changed
    if (this.mc.world != null) {
        this.mc.world.sendQuittingDisconnectingPacket();
    }

    this.mc.loadWorld((WorldClient)null);
    //
    this.mc.displayGuiScreen(new GuiMainMenu());
}

 

 

 

 

Johnibur

This issue can have severe consequence when trying to rejoin the world in the background after hitting "delete world", it will freeze the game.

Nixinova

When "Delete World" is pressed, you are sent to the menu which has a white screen (white-menu-background.png) [MC-148865]. If you try and Edit the world's options, it will overlay the in-game events (edit-world-options.png). If you try to join the Hardcore world you just left the screen will go black and the game will be completely unresponsive (rejoin-hardcore-world.png).

migrated

Being unable to delete world 1.14.3 pre 4 confirmed. Can't delete it from the saves menu or windows explorer either. And you don't have to die to be unable to delete hardcore worlds.

migrated

Still confirmed for 1.14.4 release

migrated
[media]

Issue is still existing in 1.14.4

Screen is from me trying enter that type of world 😛
Game is still running 

migrated

Fix to this issue in 1.14.4 is simple:

Tested on custom MCP 1.14.4

In `confirmCallback` after sending packet of disconnecting

SaveFormat saveformat = this.minecraft.getSaveLoader();
for (WorldSummary worldSummary : WorldSelectionList.field_212331_y) {
    if (this.minecraft.player.world.getWorldInfo().getWorldName() == worldSummary.getDisplayName()) {
        saveformat.deleteWorldDirectory(worldSummary.getFileName());
    }
}

and in button action add code below before function displaying main menu

this.confirmCallback(true);

@edit
forgot to mention about changeing access for

private List<WorldSummary> field_212331_y;

from `private` to `public static`

migrated

Yeah that happened to me once too. Also, did anyone else who got this bug have a tough time ending the Minecraft Java Program? I had a tough time stopping the game.

boq

Was fixed in 19w35a, see MC-30646 for details.

ziggurism

boq

Confirmed

Crash

Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w07a, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, ..., Minecraft 18w31a, Minecraft 1.13.1, Minecraft 1.14.2, Minecraft 1.14.3, 1.14.4

19w35a

Retrieved