The bug
If you lock your difficulty in then go into a different dimension the lock is undone. If you lock it in that dimension and go back to the original one. It will be undone again.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 19
Comments 12
I'm having the same issue in 1.8.7. The difficulty is unlocked and reverted to Easy upon moving between dimensions.
Ubuntu 14.04 64-bit system with Intel HD integrated graphics card using Oracle 8 Java Runtime Environment
Please link to this comment in the description
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The reason for this is the same as for MC-679. When the player enters a different dimension a new WorldClient
object is created an most of the data is copied from the previous WorldClient
object. Whether or not the difficulty is locked is only send when the player joins a server (or loads a world). When he changes the dimension the method net.minecraft.client.network.NetHandlerPlayClient.handleRespawn(SPacketRespawn)
does not set whether or not the difficulty is locked for the new WorldClient
.
Is it a visual glitch tho? I've been able to cycle my difficulty (Locked at hard from world gen) and it still gives the whole blurb about locking the difficulty when I click the button.
I haven't actually played on any other difficulty to see if there was a difference and I haven't cycled to peaceful (In fear some of my named hostile mobs would despawn)
Also, confirmed 1.9.4
Also, only the button is reset; the difficulty is still locked.