Util Custom Player Lists: Create your own tab list display.

Discussion in 'Resources' started by Zombie_Striker, Aug 19, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Thex7

    Very good API, but I found something that does not work well, not if it is wrong, but he commented:

    When a player joins a team this is no longer visible to other players.

    out of it all right.

    Excuse my English.
     
    Roptitou :D likes this.
  2. Offline

    Roptitou :D

    Hey @Zombie_Striker , I use a 1.7.9-1.8 spigot version, and don't work :( Plz helpMe ?

    My code error when i join my serveur (local host) :

    [14:57:27 INFO]: Ropste lost connection: Internal Exception: net.minecraft.util.io.netty.handler.codec.EncoderException: java.lang.NullPointerException

    Help me plz ?
     
  3. Offline

    Zombie_Striker

    @Roptitou :D
    What do you mean "1.7.9-1.8". Which one is it?

    Is that the full error log? There should be more to that error. Please post the full error.
     
  4. Offline

    Roptitou :D

    @Zombie_Striker Sorry for lack of information

    i use a Spigot "spigot 1.7 x 1.8 x", and when i join my server (localHost), i can't the server crash, and he kick me :/

    No error on my code, It works but when i join crash

    (My Code )

    When i launch my server :

    java.lang.IllegalArgumentException: Plugin already initialized!
    at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:122) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at fr.ropste.hub.PluginsFin.<init>(PluginsFin.java:60) ~[?:?]
    at fr.ropste.hub.PluginsFin.onEnable(PluginsFin.java:69) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:412) [Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.java:476) [Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.java:394) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.n(MinecraftServer.java:354) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.g(MinecraftServer.java:328) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.a(MinecraftServer.java:284) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.java:227) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:494) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [Spigot.jar:git-PaperSpigot-1f7d532]
    Caused by: java.lang.IllegalStateException: Initial initialization
    at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:125) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at fr.ropste.hub.PluginsFin.<init>(PluginsFin.java:60) ~[?:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_111]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_111]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_111]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_111]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_111]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:336) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:258) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.java:369) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.java:169) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    ... 2 more


    And when i join :

    Code error :

    [17:15:21 ERROR]: Could not pass event PlayerJoinEvent to Degraded v1.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:509) [Spigot.jar:git-PaperSpigot-1f7d532]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:494) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.PlayerList.c(PlayerList.java:300) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.PlayerList.a(PlayerList.java:185) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.LoginListener.c(LoginListener.java:119) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.LoginListener.a(LoginListener.java:44) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:192) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:795) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:307) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:643) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:549) [Spigot.jar:git-PaperSpigot-1f7d532]
    at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [Spigot.jar:git-PaperSpigot-1f7d532]
    Caused by: java.lang.ClassCastException: java.util.Collections$UnmodifiableRandomAccessList cannot be cast to [Lorg.bukkit.entity.Player;
    at fr.ropste.hub.PlayerList.clearPlayers(PlayerList.java:134) ~[?:?]
    at fr.ropste.hub.PlayerList.clearAll(PlayerList.java:204) ~[?:?]
    at fr.ropste.hub.PlayerList.initTable(PlayerList.java:383) ~[?:?]
    at fr.ropste.hub.PluginsFin.onJoin1(PluginsFin.java:635) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[Spigot.jar:git-PaperSpigot-1f7d532]
    ... 14 more




    Thanks for your Help :D
     

    Attached Files:

    Last edited: Dec 1, 2016
  5. @Roptitou :D
    First error doesn't seem to have anything to do with the TabList code, and second one is probably because you're running PaperSpigot.
     
    Roptitou :D likes this.
  6. Offline

    Zombie_Striker

    @Roptitou :D
    Either you re-posted your issue here, or two people here are using paper-spigot (A protocol hack that is not allowed here and will not work with any packet/NMS-using util). In either case, I will say that This util (and any other packet using utils) will not support Paper-spigot. Not only that, but you should not even be using paper spigot. For 1.7x and 1.8x, those are two updates from years ago and, for most players using those updates, used only because players want to keep their hacks and mods or server owners do not want to sign the EULA.
     
    Roptitou :D likes this.
  7. Offline

    Roptitou :D

    @Zombie_Striker So i can't resolve my probleme ? :( Bad, i change my spigot ? to other version ?
     
  8. Offline

    Zombie_Striker

    @Roptitou :D
    The only way to fix this is to not use paper spigot. If you do that, it will work.
     
    Roptitou :D likes this.
  9. Offline

    Roptitou :D

    @Zombie_Striker I have a question, Spigot exists in 1.7.x and 1.8.x? No PaperSpigot, just Spigot work in version 1.7.x and 1.8.x ? Or not ?
     
  10. Offline

    Zombie_Striker

    @Roptitou :D
    If you you spigot alone on either version it will work. It works on 1.7 and 1.8, but it works on the standalone (no paperspigot) versions since the packets changed during those two versions.
     
    Roptitou :D likes this.
  11. Offline

    Roptitou :D

    @Zombie_Striker Can you give me a link for standalone ? I don't found this Plz And thx for all :D
     
  12. Offline

    Zombie_Striker

  13. Offline

    Zombie_Striker

    Updated code:

    Added "addExistingPlayer" and "resetTablist" so 'real' players can be added. Also, if the server is version 1.8+, the heads besides a tab will now display the player's actual skin.
     
  14. Offline

    pretocki3

    @Zombie_Striker How do i call clearCustomTabs() in onDisable? PlayerList class need Player to create new instance. Or like
    for(Player player : Bukkit.getOnlinePlayers()) {
    PlayerList list = new PlayerList(player, 80);
    list.clearCustomTabs();
    }
     
  15. Offline

    Zombie_Striker

    @pretocki3
    No. You need to save those PlayerList instances when you create them. By doing that, you clear out all the stored data (regarding what the player actually sees) so it does not know what custom tabs the player is seeing. Store the PlayerList somewhere in a hashmap when you first create that instance, and then retrieve that instance in the onEnable.

    [edit] I have released an update. The new code now has PlayerList.getPlayerList(), which will allow you to get the existing playerlist by just providing the player's instance.
     
    Last edited: Feb 22, 2017
  16. Offline

    MrGriefer_

    I'm confused! Could you show me an example? Do I get all the online players and then clear the custom tabs?
     
  17. Offline

    Zombie_Striker

    @MrGriefer_
    What is the issue? Are you confused about the player list, or how to clear the custom tabs?
     
  18. Offline

    MrGriefer_

    I'm confused on how to clear the custom tabs!
     
  19. Offline

    ConectionLoseee

    Did not work :/
    You can help?
    Code:
     Could not pass event PlayerJoinEvent to TABLIST v1.2
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[server.jar:git-PaperSpigot-"8b18730"]
            at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[server.jar:git-PaperSpigot-"8b18730"]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[server.jar:git-PaperSpigot-"8b18730"]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [server.jar:git-PaperSpigot-"8b18730"]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:314) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:173) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:875) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [server.jar:git-PaperSpigot-"8b18730"]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [server.jar:git-PaperSpigot-"8b18730"]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
    Caused by: java.lang.ClassCastException: [Lorg.bukkit.entity.Player; cannot be cast to java.util.Collection
            at pl.tablist.utils.PlayerList.clearPlayers(PlayerList.java:154) ~[?:?]
            at pl.tablist.utils.PlayerList.clearAll(PlayerList.java:251) ~[?:?]
            at pl.tablist.utils.PlayerList.initTable(PlayerList.java:472) ~[?:?]
            at pl.tablist.listeners.PlayerQuitJoinListener.onPlayerJoinLater(PlayerQuitJoinListener.java:50) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_131]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_131]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) ~[server.jar:git-PaperSpigot-"8b18730"]
            ... 15 more
    
     
  20. Offline

    Zombie_Striker

  21. ClassCastException is caught when used initTable()

    Im not using PaperSpigot

    still Error in 1.11.2 spigot(NullPointerException)
    Code:
    Could not pass event PlayerJoinEvent to LHTablist v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.PlayerList.onPlayerJoin(PlayerList.java:327) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.PlayerList.a(PlayerList.java:160) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.LoginListener.b(LoginListener.java:147) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.LoginListener.F_(LoginListener.java:57) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.NetworkManager.a(NetworkManager.java:233) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.ServerConnection.c(ServerConnection.java:140) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:842) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
    Caused by: java.lang.NullPointerException
            at com.tistory.hornslied.tablist.PlayerList$ReflectionUtil.invokeMethod(PlayerList.java:687) ~[?:?]
            at com.tistory.hornslied.tablist.PlayerList$ReflectionUtil.access$8(PlayerList.java:685) ~[?:?]
            at com.tistory.hornslied.tablist.PlayerList.sendNEWPackets(PlayerList.java:475) ~[?:?]
            at com.tistory.hornslied.tablist.PlayerList.addValue(PlayerList.java:436) ~[?:?]
            at com.tistory.hornslied.tablist.PlayerList.addValue(PlayerList.java:394) ~[?:?]
            at com.tistory.hornslied.tablist.PlayerList.initTable(PlayerList.java:464) ~[?:?]
            at com.tistory.hornslied.tablist.listeners.JoinListener.onJoin(JoinListener.java:31) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_111]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_111]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.11.2.jar:git-Spigot-3fb9445-6e3cec8]
            ... 14 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 30, 2017
  22. Offline

    Zombie_Striker

    @Ludwig Hornslied
    I just released an update to the class that should fix this problem. Copy the new version of the class into your project and tell me if it still happens.
     
  23. exceptions aren't caught anymore
    http://imgur.com/iJaF8zz
    but it works only in 1.11.2 and doesn't display nickname i typed in 1.8
     
  24. Offline

    Zombie_Striker

    @Ludwig Hornslied
    Are there any errors in the console for 1.8?

    [Edit] What do you mean by nickname? Is it a nickname you provide or one provided by another plugin?
     
  25. Nope, nothing appears in console

    [Nickname] It is my own nickname I used since 2 years ago, it's my german name
     
  26. NullPointerException on this line: PlayerList.getPlayerList(p).clearCustomTabs();
     
  27. Offline

    Zombie_Striker

  28. Offline

    Zombie_Striker

    @Blackwing_Forged
    The NPE is not caused from my plugin. Something on line 40 of setDefaultOnJoin is null.
     
  29. Line 40 of SetDefaultOnJoin is: PlayerList.getPlayerList(p).clearCustomTabs();
    And the p is Player p = e.getPlayer(); from the PlayerJoinEvent
     
Thread Status:
Not open for further replies.

Share This Page