This is a issue which happened before 1.9 snapshots but not every time. Now in the 1.9 snapshots it seems to happen every time.
When the player gets kicked in a singleplayer world for example for invalid movement, the client freezes instead of leaving the world properly:
[20:27:39] [Server thread/WARN]: Marcono1234 was kicked for floating a vehicle too long!
[20:27:39] [Server thread/INFO]: Marcono1234 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[20:27:39] [Server thread/INFO]: Marcono1234 left the game
[20:27:39] [Server thread/INFO]: Stopping singleplayer server as player logged out
[20:27:40] [Server thread/INFO]: Stopping server
[20:27:40] [Server thread/INFO]: Saving players
[20:27:40] [Server thread/INFO]: Saving worlds
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/Overworld
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/Nether
[20:27:40] [Server thread/INFO]: Saving chunks for level 'End Test'/The End
How to reproduce
Use the following command (see MC-79818):
/tellraw @p {"text":"Click me","clickEvent":{"action":"run_command","value":"\u00A7"}}
The reason
In Minecraft 1.8 (decompiled using MCP) the reason for this to happen seems to be that the initiateShutdown()
method of the /Client/src/net/minecraft/server/integrated/IntegratedServer.java
class is called twice. One time by the server because the hosting player left the game and the second time by the client when the main menu is loaded (or the other way around). Only the server should probably call this method.
The following displays in which order the methods are called. However this is not correct with the timing as the server calls the initiateShutdown()
method after the client called it.
Server | Client |
---|---|
/Client/src/net/minecraft/network/NetHandlerPlayServer.java
| /Client/src/net/minecraft/client/Minecraft.java
|
/Client/src/net/minecraft/network/NetworkManager.java
| /Client/src/net/minecraft/client/multiplayer/PlayerControllerMP.java
|
/Client/src/net/minecraft/network/NetHandlerPlayServer.java
| /Client/src/net/minecraft/network/NetworkManager.java
|
- | /Client/src/net/minecraft/client/network/NetHandlerPlayClient.java
|
- | /Client/src/net/minecraft/client/Minecraft.java
-> loadWorld(WorldClient worldClientIn, String loadingMessage)
|
Related issues
is duplicated by
relates to
Comments


What can't you reproduce? The cases in which the player is kicked or doesn't the client freeze for you?
I added a command to reproduce as well

The first one, thanks =)
Can confirm for MC 1.12.1.

Appears to have been fixed in 18w01a. IntegratedServer.initiateShutdown
is only called once (from the client thread) in 18w01a, while it was called on both the server and client threads in prior versions. Checked with JDB, by setting an appropriate breakpoint; in 1.12.2 it is chd.x
; in 17w50a it is (per forge's MCPInfo) clm.q
; and in 18w01a it is cmd.q
. Unfortunately I'm not entirely sure why it's not getting called twice anymore, as I don't see what changed.

Happening again as per MC-72943 (this issue is effectively a duplicate of that, but for a different means of reproduction). I haven't personally reproduced this variant, but I can confirm that the methods are again called twice in 18w20a, but not in 18w19b.
Can't reproduce