Tablist Changer (I promise there is not a plugin for what i need made already)

Discussion in 'Archived: Plugin Requests' started by GladimusCraft, May 12, 2013.

  1. Offline

    GladimusCraft

    So i've been trolling the bukkit forums for way to long, and i'm not sure why people haven't made this yet, so i'll ask for it here.

    I want a plugin that adds colors to the playerlist. However, all of the plugins have permission nodes or complicated configs with prefixes and all that to be able to set the colors, but those become the dominant colors.

    I have a plugin (the bukkitgames) that changes the player color depending on if they won the game, and i have chat manager making the playername blue if people donate.

    So, for the plugin: I just want something that scans the color that their name would be if they chat, and displays it on the playerlist. So if you suddenly get de-opped, the color on the tablist would change from red to white, because when you chat your name would no longer be red on the chat. This way, the color plugin can let other plugins decide the color, and it just shows what those plugins decide.

    preferably just apply for everyone, so there is no need for permissions. The only commands i can think of would be to enable/disable it in game. but both of those are negligible.

    I hope this is an easy request, and if it was made, it would be the greatest thing ever.

    Thank you in advance.
     
  2. Offline

    GusGold

    You mustn't have had a very good look... Try here.
     
  3. Offline

    GladimusCraft

    You musn't have read my question/not ever used this plugin/read about the plugin. I specifically complained about the permission nodes setting the colors. The problem with that is that when a permission node sets a color in these plugins, it forces the tablist to be that color. If i were to have a color change done by the plugin depending on my state of play, it would not update to match; it would continue to be blue.

    The name color change that this plugin is doing isn't anything to do with permissions, it just turns you gold if you won the last game.
     
  4. Offline

    GusGold

    GladimusCraft I did read, have used, and did read about the plugin. Setting up permissions for it is easier than pie. For corresponding to the player's chat colour, just set the group to have the same colour for their display name and their tab name colour permission. If that can't fit you needs, I might see what I can develop.
     
    GravedigginSearchBar likes this.
  5. Offline

    GladimusCraft

    I'll try to explain better. The plugin that i am using for hunger games will check to see who won the last game and change the player name to gold, to show that they are the winner. With it doing this, it also changes the tablist name. So, with just this plugin installed and nothing else, everyone will be white exception of the winner, who will have a gold chat name and a gold playerlist name. This is what i want.

    However, i can't use PEX to change the tablist. So when i use PEX and chatmanager to change the chat name of the vip rank, their tablist name remains white even though their chat name is blue.

    So if i put in a plugin that changes the tablist, for example with a permission, the tablist will remain that color no matter what happens. This means that if they happen to be a winner, the hungergames plugin will make a VIP gold-named in chat, but the color changing tablist plugin will force their name to be blue in the tablist, which makes them not match.


    So, i'm looking for something that will decide the tablist color not based on a permission, but rather on the actual color of their name as it is in chat, because if i use a permission node of any sort, it doesnt allow the hunger games plugin to change the tablist as well. Does that make sense?
     
  6. Offline

    GusGold

    Yeah. I was under the assumption that your winner was added via permissions. I can't make it something for you right now, but if you still haven't got it in a few days, tahg me and I will have a go.
     
  7. *quickly gets on bukkit dev* *makes a project of what exactly you want* *posts link here*
    *win-win*
     
    GladimusCraft and Williscool98 like this.
  8. Offline

    GladimusCraft

    InspectorFacepalm I would not mind that ;)
    timtower i need your brilliance
     
  9. Offline

    timtower Administrator Administrator Moderator

    I am famous already?? :confused:
    Can look into it, won't change instant though, probably in an configurable time to reduce lag.
     
    Zarius likes this.
  10. Offline

    Necrodoom

    GladimusCraft could be a problem if a player name is already 15 characters.
     
  11. Offline

    jacklin213

    will be a problem -3- once over 15 it will return illegal string name error or sumthing like that , aka NPE
     
  12. Offline

    GladimusCraft

    necrodoom jacklin213 That is a problem common among plugins like this. It's usually solved by taking letters from the player name. That doesn't bother me though as long as its the correct color.
     
  13. Offline

    timtower Administrator Administrator Moderator

  14. Offline

    evilmidget38

    That doesn't do what he's requesting, all that does is limit the size of their name on the tab list. Additionally, you shouldn't be using Bukkit API methods from an asynchronous task, as almost all of them aren't thread safe(Server#getOnlinePlayers() isn't thread safe).

    Decompiled source of jar:
    Codez (open)

    Code:Java
    1.  
    2. package nl.timdebrouwer.listcolorlikeme;
    3.  
    4. import org.bukkit.Server;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.scheduler.BukkitRunnable;
    7.  
    8. public class DisplayChanger extends BukkitRunnable
    9. {
    10. private ListColorLikeMe plugin;
    11.  
    12. public DisplayChanger(ListColorLikeMe listColorLikeMe)
    13. {
    14. this.plugin = listColorLikeMe;
    15. }
    16.  
    17. public void run()
    18. {
    19. Player[] players = this.plugin.returnServer().getOnlinePlayers();
    20. for (Player player : players) {
    21. String string = player.getDisplayName();
    22. string = string.substring(0, Math.min(string.length(), 15));
    23. player.setPlayerListName(string);
    24. }
    25. }
    26. }
    27.  

    Code:Java
    1.  
    2. package nl.timdebrouwer.listcolorlikeme;
    3.  
    4. import org.bukkit.Server;
    5. import org.bukkit.configuration.file.FileConfiguration;
    6. import org.bukkit.plugin.java.JavaPlugin;
    7.  
    8. public class ListColorLikeMe extends JavaPlugin
    9. {
    10. public DisplayChanger changer;
    11.  
    12. public void onEnable()
    13. {
    14. saveDefaultConfig();
    15. getConfig();
    16. this.changer = new DisplayChanger(this);
    17. this.changer.runTaskTimerAsynchronously(this, getConfig().getInt("interval"), getConfig().getInt("interval"));
    18. }
    19.  
    20. public Server returnServer() {
    21. return getServer();
    22. }
    23. }
    24.  

     
  15. Offline

    GladimusCraft

    evilmidget38 Was this directed to the code in his plugin, or at the nature of my request? If it was the latter, i'm not sure exactly what that means, could you explain it?

    I'll try it out and report back here to see exactly what it does.

    timtower I didn't get any errors, but no color change.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  16. Offline

    timtower Administrator Administrator Moderator

    evilmidget38 Should I remove the asynch part? And It just takes the displayname and puts it into the list ( as far as I know )
    GladimusCraft It was directed at me ;)
    EDIT : shit
     
  17. Offline

    evilmidget38

    timtower Run it as a sync task(if you even need to use a task, you probably won't) rather than an async task.
     
    lukegb likes this.
  18. Offline

    timtower Administrator Administrator Moderator

    evilmidget38 I am running it as a task to auto-update ;)
    And do you know why the colors aren't changing?
     
  19. Offline

    aronuserparty98

    ColoredTablist and turn permissions off. Voila! Now everyone's colours change accordingly to whether they get (de-)opped or switch groups. Be sure to set the colours per each group in the config-file.

    /Aron

    PS.
    Agreed.
     
    GravedigginSearchBar likes this.
  20. Offline

    GladimusCraft

    Before coming on and being a smartass, it probably would have been a good idea to try it out for yourself. That was the first one i tried. I set usepermissions to false, and retarted the server. The name does not update according to how the chat looks. With the permissions off, vault installed, and the plugin running, there is still a white name on the tablist.

    Setting it according to groups still replicates my problem: It will permanently make their name that color, and not allow it to be gold when they are the winner.
     
  21. Offline

    timtower Administrator Administrator Moderator

    GladimusCraft I need to know something to fix my bug, is the game plugin changing the display name or the prefix?
     
  22. Offline

    GladimusCraft

    timtower Just the display name. But i'm using a prefix to change the display name on PEX and chat manager, but the plugin is able to overwrite that for the winner on the display name.
     
  23. Offline

    timtower Administrator Administrator Moderator

    GladimusCraft Working for me with just looking at the display name, the game plugin is using exactly the same thing.
    Prove
     
  24. Offline

    GladimusCraft

    timtower Did you by chance have the bukkit games plugin, pex, and chat manager in?
     
  25. Offline

    timtower Administrator Administrator Moderator

    Non of them, just looked into the source of the bukkitgames and I made my test plugin so it does the same thing. So I think that one of those plugins are causing trouble
     
  26. Offline

    aronuserparty98

    My intention was never to come off as a smartass, or someone willing to be one. I was simply trying to help you out, but if it's not appreciated I can stop.
    Of course I've tried the plugin myself, and I can insure you that it does work. However, I feel no reason to help you out with it, since it's not (as said) appreciated.
    I did quote someone who did, since I agreed with his opinion about you not having a good look. As I realize now, that's not the problem.

    Good day.

    /Aron
     
  27. Offline

    GladimusCraft

    timtower If the hunger games is using the same code, is there a way that you can give your plugin priority over the tablist?
     
  28. Offline

    timtower Administrator Administrator Moderator

    GladimusCraft It schould be doing this already, maybe changing the config so the time will be less, might fix it, not sure though
     
  29. Offline

    GladimusCraft

    timtower will you post the link to the edited code?
     
  30. Offline

    timtower Administrator Administrator Moderator

    GladimusCraft The plugin creates an config file in the plugins folder, there you need to edit it ;)
     

Share This Page