Animated-TabList

Animated-TabList

65.2k Downloads

TabList's groups modifies player's name tags visibility

Disguys opened this issue ยท 15 comments

commented

Type of bug

Compatibility issue

TabList version

5.6.2

Software version

Paper version git-Paper-194 (MC: 1.18.1)

Relevant plugins

HideNicksPlayers & TabList

Console error (if applicable)

https://paste.gg/p/anonymous/4ed58b85bc1e46a2945f394379fdb502

TabList configuration files

https://paste.gg/p/anonymous/1fda94923c68493b82b2ab5a470f4b2b

Bug description

There was an error with the compatibility of the Hide Nicks Players plugin.

The fact is that when I enable on the change-prefix-suffix-in-tablist parameter, the nicknames of the players begin to appear again, and I need this function exclusively for the prefix of the players in tablist.

Source code: https://github.com/StumpStudio/Hide-Nicks-Players
Download plugin: https://github.com/StumpStudio/Hide-Nicks-Players/releases

Playback Steps:

  1. Install Hide Nick Players & TabList plugins
  2. Open the config.yml file in the Tab List plugin folder
  3. Enable the change-prefix-suffix-in-tablist setting
  4. Reload tablist plugin
commented

This is how change-prefix-suffix-in-tablist option should supposed to work. This option will displays a prefix next to the player name in the tablist and not to hide the name of the player name in tab using other plugins.

commented

I forgot to give some details, sorry.
Plugin Hide Nicks Players allows you to hide nickname above your head, and not in a tablist.
And when I enable on this parameter, the nicknames start showing up again over head.
I can record a video with this error if necessary
image

commented

I made a temp fix for this not sure if it works. There was a same issue some time ago but it was about that the name tag is not visible for players. You can try this fixed version by installing from Actions page. Select the first one and find Artifacts.

commented

I installed, but unfortunately the plugin does not enable on when the server start.

[13:32:42 ERROR]: Error occurred while enabling TabList v5.6.2 (Is it up to date?)
java.lang.NoClassDefFoundError: hu/montlikadani/tablist/protocol/events/PacketAdapter
        at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:1012) ~[?:?]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:197) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:108) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at hu.montlikadani.tablist.TabList.loadListeners(TabList.java:235) ~[TabList-bukkit-5.6.2.jar:?]
        at hu.montlikadani.tablist.TabList.onEnable(TabList.java:98) ~[TabList-bukkit-5.6.2.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:501) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.1.jar:git-Paper-194]
        at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.1.jar:git-Paper-194]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:727) ~[paper-1.18.1.jar:git-Paper-194]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:503) ~[paper-1.18.1.jar:git-Paper-194]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:313) ~[paper-1.18.1.jar:git-Paper-194]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-194]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-194]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: hu.montlikadani.tablist.protocol.events.PacketAdapter
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        ... 21 more
[13:32:42 INFO]: [TabList] Disabling TabList v5.6.2
commented

Try now, I managed to fix this

commented

Plugin has been started, but for some reason, when you enable on this setting, nicknames begin to appear again
image

commented

But it does not issue any error to the console at the same time anymore

commented

I also recorded a video for a more detailed demonstration of this error.
https://www.youtube.com/watch?v=TuT_hZVt57A

commented

The plugin gave an error when disable server, maybe it will help somehow
https://pastebin.com/i6G3bRz6

commented

That option is just hides all the player's name tags, breaking other name tag plugin visibility option. We literally need a solution to hide or make it visible the name tags depending from the currently created scoreboard team by a plugin or by a vanilla command.

commented

@montlikadani in another plugin on TAB from NEZNAMY, I found one function in the config invisible-nametags: false, after I switched to true, my problem was fixed. Maybe you should also add this setting? https://github.com/NEZNAMY/TAB/wiki/Feature-guide:-Nametags

But actually I implemented the same way, but seems does not really work.

String optionName = null;
for (Team team : player.getScoreboard().getTeams()) {
if (ClazzContainer.isTeamOptionStatusEnumExist()) {
Team.OptionStatus optionStatus = team.getOption(Team.Option.NAME_TAG_VISIBILITY);
switch (optionStatus) {
case FOR_OTHER_TEAMS:
optionName = "hideForOtherTeams";
break;
case FOR_OWN_TEAM:
optionName = "hideForOwnTeam";
break;
default:
if (optionStatus != Team.OptionStatus.ALWAYS) {
optionName = optionStatus.name().toLowerCase(Locale.ENGLISH);
}
break;
}
} else {
NameTagVisibility visibility = team.getNameTagVisibility();
switch (visibility) {
case HIDE_FOR_OTHER_TEAMS:
optionName = "hideForOtherTeams";
break;
case HIDE_FOR_OWN_TEAM:
optionName = "hideForOwnTeam";
break;
default:
if (visibility != NameTagVisibility.ALWAYS) {
optionName = visibility.name().toLowerCase(Locale.ENGLISH);
}
break;
}
}
}
if (optionName != null) {
if (ServerVersion.isCurrentEqualOrHigher(ServerVersion.v1_17_R1)) {
for (Object f : ClazzContainer.getScoreboardNameTagVisibilityEnumConstants()) {
if (optionName.equalsIgnoreCase((String) ClazzContainer.getNameTagVisibilityNameField().get(f))) {
ClazzContainer.getScoreboardTeamSetNameTagVisibility().invoke(scoreTeam, f);
break;
}
}
} else {
ClazzContainer.getNameTagVisibility().set(newTeamPacket, optionName);
}
}

commented

Maybe try copying over all the team settings from existing team and then using these settings on fake team that the plugin uses?

commented

There are no fake teams. All scoreboard teams will be created and sent to the client and they are all visible between plugins which trying to access any scoreboard teams.
Take a look at the source of how the groups are handled: https://github.com/montlikadani/TabList/blob/master/bukkit/src/main/java/hu/montlikadani/tablist/tablist/groups/impl/ReflectionHandled.java

commented

@montlikadani in another plugin on TAB from NEZNAMY, I found one function in the config invisible-nametags: false, after I switched to true, my problem was fixed. Maybe you should also add this setting?
https://github.com/NEZNAMY/TAB/wiki/Feature-guide:-Nametags

commented

The above linked commit will fixes this issue. You can try this fixed version by installing from Actions page. Select the first one and find Artifacts.