#Velocitab - Option to Treat Spectators as Survival Players

1 messages · Page 1 of 1 (latest)

feral crypt
#

Vanilla sorting and display affects players in spectator mode. They are sorted to the bottom of tab, and have the grayed out name. An option to disable this and keep them sorted as Survival players would be awesome!

Simply adding .gameMode(0) to the tab list builder didn't work, unfortunately.

In PlayerTabList.java


    @NotNull
    private CompletableFuture<TabListEntry> createEntry(@NotNull TabPlayer player, @NotNull TabList tabList) {
        return player.getDisplayName(plugin).thenApply(name -> TabListEntry.builder()
                .profile(player.getPlayer().getGameProfile())
                .displayName(name)
                .latency(0)
                .tabList(tabList)
+               .gameMode(0)
                .build());
    }

    private TabListEntry createEntry(@NotNull TabPlayer player, @NotNull TabList tabList, @NotNull Component displayName) {
        return TabListEntry.builder()
                .profile(player.getPlayer().getGameProfile())
                .displayName(displayName)
                .latency(0)
                .tabList(tabList)
+               .gameMode(0)
                .build();
    }

latent vapor
#

Think the stuff that does this is fairly intricate

feral crypt
#

Looks like just canceling the Player Info Update packet on game mode change to spectator works, but I think that has to be done on the backend servers so probably OOS for Velocitab

eternal cairn
feral crypt
#

Thank you! I'll give it a try!