Tablist not updating

Discussion in 'Spigot Plugin Development' started by DotRar, Jun 1, 2017.

  1. I'm trying to order a tablist. I have it ordered, in a list called newData. However packet.setData(newData); (
    WrapperPlayServerPlayerInfo#setData) does not set the tablist to be in this order, it still stays in login order. Do I need to do anything extra?
  2. Made this tutorial about tablists and there is written why your plugin doesn't keep the order.
    The order is defined by the entity name, not the display name. To change the order you need to create custon entities with order names (00, 01, 02) and set there tablistName. There is no other way because ordering is done by the client, not the server!

    The link to the tutorial
  3. How do I set the tablist name
  4. Use
    Code (Text):
    player.listName =  = new ChatComponentText(listName);
    The player has to be a EntityPlayer instance!
  5. Yeah I saw that a few minutes later. Got everything working, thanks :)
  6. Code (Text):
    EntityPlayer[] playersNMS = new EntityPlayer[Bukkit.getOnlinePlayers().size()];
                    Player receiver = e.getPlayer();

                    int current = 0;
                    for (Player player : Bukkit.getOnlinePlayers()) {
                        playersNMS[current] = ((CraftPlayer) player).getHandle();

                    PacketPlayOutPlayerInfo removePacket = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, playersNMS);

                    ((CraftPlayer) receiver).getHandle().playerConnection.sendPacket(removePacket);
    This code seems to crash the server
  7. I think i know what your problem is.... Thr nms and craft classes are in a package that contains the version of spigot. Every release this package is different and the imports are different. You could solve this by using the same jar or maven version for developing as for your server. You could also use reflect and wrappper classes. There are many tutorials about that. If that is not the problem, could you post the error log.
  8. The server is running some version of 1.8 (not sure which) and the plugin is compiled with 1.8.8. Does this still matter?
  9. If it is NOT the exact same release, yes it matters. The packages of nms look like:
    Code (Text):
    for example
    Code (Text):
    That R1 is the problem. If you compiled using release 1 and you run using release 2 is is different. Try running and compiling it with the exact same jar file.

    Could you post your error log? It woul just be usefull.
  10. Code (Text):
    [Server thread/ERROR]: [TabListSorter] Unhandled exception occured in onPacketSending(PacketEvent) for TabListSorter
        at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_131]
        at java.util.HashMap$ Source) ~[?:1.8.0_131]
        at$1.onPacketSending( ~[TabListSorter.jar:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.PacketFilterManager.handlePacket( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ChannelInjector.processSending( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ChannelInjector.access$500( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ChannelInjector$5.handleScheduled( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ChannelInjector$5.onMessageScheduled( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable( [ProtocolLib.jar:4.2.1]
        at com.comphenix.protocol.injector.netty.EventLoopProxy.execute( [ProtocolLib.jar:4.2.1]
        at net.minecraft.server.v1_8_R3.NetworkManager.a( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.NetworkManager.handle( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerConnection.sendPacket( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerList.sendAll( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.PlayerList.tick( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A( [spigot.jar:git-Spigot-db6de12-18fbb24]
        at [spigot.jar:git-Spigot-db6de12-18fbb24]
        at Source) [?:1.8.0_131]
    [16:11:07] [Server thread/ERROR]: Parameters:
      [email protected][
        b=[PlayerInfoData{latency=4, gameMode=SURVIVAL, [email protected][id=6162b37f-e534-4134-8282-eb5986219845,name=MrGreenJam,properties={textures=[[email protected]]},legacy=false], displayName=null}, PlayerInfoData{latency=3, gameMode=SURVIVAL, [email protected][id=b361d7b5-7f3a-4cfc-a062-0fbe29f00916,name=LMNTS,properties={textures=[[email protected]]},legacy=false], displayName=null}, PlayerInfoData{latency=1, gameMode=SURVIVAL, [email protected][id=9d030c15-9f31-444c-bc41-9a88aa18731d,name=FireFlies,properties={textures=[[email protected]]},legacy=false], displayName=null}]
  11. Same bit of code is giving a stack overflow exception now
  12. This is an error from protocol lib. Try it without protocol lib enabled. That might work.

    Also ask the developers of protocol lib if they know what it is.