NametagEdit

721k Downloads

1.13.x Support

JustOneMoreBlock opened this issue · 7 comments

commented

Hello,

Currently, I'm not sure what happened to my developer. However, I'm the owner of the plugin and don't know much about java coding.

https://github.com/sgtcaze/NametagEdit/blob/master/src/main/java/com/nametagedit/plugin/packets/PacketData.java

I doubt this is all I would need to update to 1.13.x as there have been many changes. The end goal is we support all versions on the same JAR from 1.7.x to 1.12.x.

People have reported white nick names and likely because of the changes in 1.13.x. The colors are now defined by the team color and then you change the players color using the color command.

I'm requesting for anyone to assist me in updating the plugin. I'll only accept changes from developers who are known in the community.

  • Kind Regards
    Cory
commented

I have gotten 1.13 support working to a point.

I've gotten suffixes and prefixes with color code support working as intended as that was fairly simple with copying a new enum line in PacketData for v1_13 with the same variables. Display name, suffix, and prefix no longer takes a String variable and needs to be converted to a new ChatComponent object via reflection, which is fairly simple to do with also detecting the client version, however as mentioned by yourself, the player name is a bit more of a challenge as there is an extra step to give it color now.

To set the player name color, another packet needs to be sent via PacketAccessor. It needs to be sent as another piece of PacketData as a EnumChatFormat color. Under PacketPlayOutScoreboardTeam this is the "g" variable. This will set the player team/name color. I've been able to set a single color code but I've not found a way to be able to set the text bold and a color for example and this may not be possible and is now a limitation with 1.13.

My knowledge is limited into how to reflect Enum classes for EnumChatFormat correctly so at the moment I've had to import CraftBukkit 1.13 so my code is not currently backwards compatible. I think an extra bit of data will also need to be logged in the flatfile or MySQL database as to what color you want the player name/team to be. If it is possible, which I'm not sure if it is, if the color could be grabbed from the prefix and applied to the player name this could remove the need to do this.

I'm going to be going away for just over a week but I thought I'd post my current findings for you. If you want I can offer more support on my return.

EDIT: Since writing this I have found a way to grab the color from the prefix so the extra data to be set in a flatfile or MySQL is not needed. The only limitation I have now is how to reflect an Enum. For me, it would be how to reflect this from net.minecraft.server for example: EnumChatFormat.valueOf("DARK_RED").

commented

Okay, thank you.

commented

I've been able to reflect the EnumChatFormat now. I'm currently testing my additions to the code on my 1.12.2 and 1.13 servers. So good news is I have a working 1.13 and backwards compatible version!

Once I get back from my holiday next week, if I'm not told of any bugs while I've been away I'll post my code on GitHub and make a pull request for you.

commented

I need 1.13 support any news?

commented

@JustOneMoreBlock I can be an coder, I'm from Russia, where can we discuss this?

commented

I have raised a pull request for my 1.13 version here