Closed AxeVillager closed 6 years ago
Thank you for the well-documented report!
I managed to fix the issue. Turns out I had forgotten to write the DataWatcher when manually respawning players after their names changed on the ProtocolLib implementation. Download the latest version of 1.1-SNAPSHOT or run the command mvn clean -U install
if you are using maven, and you should be good to go.
Thank you so much, both for fixing the issue and responding so quickly! Truly marvelous!
Glad I could be of help!
I apologize if this is not properly done. Because of little experience with GitHub I don't know if it is possible for you to open the issue now that you have closed it. I hesitate to create a new issue since I feel like the problem I encounter is very similar to what this issue is all about. Please excuse me if this is not handled correctly, I am willing to create a new issue if need be.
Even though the skin properly updates upon name change, the items the player is carrying and has equipped disappear when changing name. Identical to the original issue, the items appear invisible until the player is loaded anew by the Minecraft client.
Axe_Villager has armour and weapons equipped before changing name.
The armour and weapons disappear upon name change. Axe_Villager does in fact still carry what he carried before, it is just not visible for the other player.
Is it possible to make the items the player holds and carries reappear?
Tested on: Spigot 1.12.2
, ProtocolLib 4.4.0-SNAPSHOT-b399
and NameTagChanger v1.1-SNAPSHOT
(updated version).
Interesting. Like you say, the issue is quite similar to the previous one, so I think it might be a good idea to just reopen this issue (although I believe this issue is caused by something different in the code).
I'll see what I can do.
Turns out there is a whole separate packet for entity equipment. I have now fixed it so it gets sent when manually respawning the players.
Redownload the latest version of 1.1-SNAPSHOT
and you should no longer have the issue.
Now the outer skin layer, weapons and armour update as it should. However, it introduced a new issue: When a player changes name while other players are online, the other players are kicked from the server.
In the server's console, no stacktrace is sent apart from a sign of null pointer exceptions java.lang.NullPointerException
, two for each player kicked, without any other information.
The picture below displays the exception in Minecraft a player receives upon being kicked when a player changes name.
In case it is needed, here is that same Internal Exception
in text form:
Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(2) exceeds writerIndex(4): PooledUnsafeDirectByteBuf(ridx: 4, widx: 4, cap: 4)
I thought perhaps this was caused by something that wasn't related to the plugin, so I did some tests to investigate its behaviour:
For all the tests I ran, the issue stopped only when I disabled the plugin. Therefore I reason it is in fact the plugin RolePlayName
that is using NameTagChanger v1.1-SNAPSHOT
and ProtocolLib 4.4.0-SNAPSHOT-b399
that causes the issue.
Is this fixable?
Right, and this never happened before the most recent change that I made?
Correct, this never happened before the most recent change that you made.
Turns out this is actually an issue with ProtocolLib. A method which says it never returns null returns null for ItemStacks with Material.AIR
converted to CraftItemStacks.
I will report this in the ProtocolLib repository. In the mean time, I have pushed an update which will work around this error.
If there are no more problems, then we can fingers crossed close this issue.
Wonderful! The problem is fixed and I haven't encountered any other issues as of now. It seems you can possibly close this once and for all. Thank you!
Great! I will now close this issue.
I have also reported the ProtocolLib issue in the ProtocolLib repo.
After changing nametag, other players don't see the outer layer of the skin of the player until the skin loads for them again. This can be fixed by reconnecting to the server or walking away and coming back, making the Minecraft client load the skin again. However, I would rather this was not needed. After changing name, I would like the player's skin to update properly without having to do anything else.
The code I am using is as following. I am using
NameTagChanger
'schangePlayername(player, newName)
method.In the JavaDocs I am told it is not necessary to update the player by the use of the
updatePlayer(player)
method sincechangePlayerName(player, name)
does that automatically. Even so, the skin is not updating properly.I have tried to call the
updatePlayer(player)
method, to no avail. The skin still doesn't appear as it should.The pictures below show this in action.
Tested on:
Spigot 1.12.2
,ProtocolLib 4.4.0-SNAPSHOT-b399
andNameTagChanger v1.1-SNAPSHOT
.