Solved 2 lines on a scoreboard glitch

Discussion in 'Plugin Help/Development/Requests' started by sgavster, Mar 9, 2015.

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

    sgavster

    Hello! I was working on my server plugin but it is not working right.


    Code:
    package me.sgavster.qmc.func;
    
    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.ScoreboardAdd;
    import me.sgavster.qmc.util.Scroller;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
    
    public class scoreBoard implements Runnable, Listener {
    
    
        Scroller name = new Scroller(
                "&bWelcome to the &6Quadlar&2MC &bofficial server!", 30, 2, '&');
    
        public static Main m;
    
        public scoreBoard(Main main) {
            m = main;
        }
    
        double tps = Lag.getTPS();
        double lag = Math.round((1.0D - tps / 20.0D) * 100.0D);
    
        public void run() {
    
    
            ScoreboardManager man = Bukkit.getScoreboardManager();
            Scoreboard b = man.getNewScoreboard();
            Objective j = b.registerNewObjective("qmc", "dummy");
            j.setDisplaySlot(DisplaySlot.SIDEBAR);
    
            for (Player a : Bukkit.getOnlinePlayers()) {
                int x = a.getLocation().getBlockX();
                int y = a.getLocation().getBlockY();
                int z = a.getLocation().getBlockZ();
    
                j.setDisplayName(name.next());
    
                ScoreboardAdd.addScore(j, "&2X", "&b" + Integer.toString(x), 2, 1);
                ScoreboardAdd.addScore(j, "&2Y", "&b" + Integer.toString(y), 4, 3);
                ScoreboardAdd.addScore(j, "&2Z", "&b" + Integer.toString(z), 6, 5);
                ScoreboardAdd.blankSpace(j, "", 7);
                ScoreboardAdd.addScore(j, "&bLag", "&b" + Double.toString(lag) + "%", 9, 8);
            }
    
            for (Player p : Bukkit.getOnlinePlayers()) {
                p.setScoreboard(b);
            }
        }
    }
    
    And this is what it does:
    [​IMG]

    Basicly all the coord show 2, and I can't fix it.

    Thanks for any help!

    * note, this happens when 2 players are on, not one, so I think the more the players the more the lines.
     
  2. Offline

    Konato_K

    @sgavster You need one scoreboard per-player.

    Also don't make a new scoreboard everytime, just modify the one you already have, this prevents scoreboard flickering.
     
  3. Offline

    sgavster

    @Konato_K made it so it's not a new scoreboard now. What is the easiest way to make one for each player with it being updated constantly?
     
  4. Offline

    Konato_K

    @sgavster Considering your moving letters and coordinates, I'd say a runnable, one single runnable and a Map<UUID, Scoreboard>

    In your runnable you'll loop through all the UUIDs of the players and update them according.
     
  5. Offline

    sgavster

    @Konato_K I have it in a Runnable class, and I've never really used UUID's, do you think I could get an example?

    Sorry, I haven't really coded in a while, still getting used to things. :/
     
  6. Offline

    sgavster

    @CodePlaysMinecraft but how would I use that for the scoreboard? I've tried something like that but doesn't work.
     
  7. @sgavster
     
  8. Offline

    sgavster

    @CodePlaysMinecraft I saw that, I still don't know exactly what to do.. I'm very confused.

    My computer was erased, because of a virus, and I lost all of my plugins;

    I had this code before and it worked fine so I am very confused.
     
  9. Offline

    MaTaMoR_

    you dont have to store the scoreboard
    Code:java
    1.  
    2. player.getScoreboard()
    3.  
     
  10. Offline

    sgavster

    @MaTaMoR_ Okay, I tried this:

    Code:
    package me.sgavster.qmc.func;
    
    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.ScoreboardAdd;
    import me.sgavster.qmc.util.Scroller;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
    
    public class scoreBoard implements Runnable, Listener {
    
        Scroller name = new Scroller(
                "&bWelcome to the &6Quadlar&2MC &bofficial server!", 30, 2, '&');
    
        public static Main m;
    
        public scoreBoard(Main main) {
            m = main;
        }
    
        ScoreboardManager man = Bukkit.getScoreboardManager();
        Scoreboard b;
        Objective j;
    
        double tps = Lag.getTPS();
        double lag = Math.round((1.0D - tps / 20.0D) * 100.0D);
    
        public void run() {
    
            for (Player a : Bukkit.getOnlinePlayers()) {
                int x = a.getLocation().getBlockX();
                int y = a.getLocation().getBlockY();
                int z = a.getLocation().getBlockZ();
    
                b = a.getScoreboard();
    
                if (b == null) {
                    Bukkit.broadcastMessage("np");
                    b = man.getNewScoreboard();
                    j = b.registerNewObjective("qmc", "dummy");
                    j.setDisplaySlot(DisplaySlot.SIDEBAR);
                } else {
                    Bukkit.broadcastMessage(name.next());
                    j.setDisplayName(name.next());
                   
    
                    ScoreboardAdd.addScore(j, "&2X", "&b" + Integer.toString(x), 2,
                            1);
                    ScoreboardAdd.addScore(j, "&2Y", "&b" + Integer.toString(y), 4,
                            3);
                    ScoreboardAdd.addScore(j, "&2Z", "&b" + Integer.toString(z), 6,
                            5);
                    ScoreboardAdd.blankSpace(j, "", 7);
                    ScoreboardAdd.addScore(j, "&bLag", "&b" + Double.toString(lag)
                            + "%", 9, 8);
                    a.setScoreboard(b);
                }
            }
        }
    }
    
    But I get an NPE at line 50


    [​IMG]

    @MaTaMoR_ I fixed the NPE with this code:

    Code:
    package me.sgavster.qmc.func;
    
    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.ScoreboardAdd;
    import me.sgavster.qmc.util.Scroller;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
    
    public class scoreBoard implements Runnable, Listener {
    
        Scroller name = new Scroller(
                "&bWelcome to the &6Quadlar&2MC &bofficial server!", 30, 2, '&');
    
        public static Main m;
    
        public scoreBoard(Main main) {
            m = main;
        }
    
        ScoreboardManager man = Bukkit.getScoreboardManager();
        Scoreboard b = man.getNewScoreboard();
        Objective j;
    
        double tps = Lag.getTPS();
        double lag = Math.round((1.0D - tps / 20.0D) * 100.0D);
    
        public void run() {
    
            for (Player a : Bukkit.getOnlinePlayers()) {
                int x = a.getLocation().getBlockX();
                int y = a.getLocation().getBlockY();
                int z = a.getLocation().getBlockZ();
    
                j = b.getObjective("qmc");
    
                if (j == null) {
                    Bukkit.broadcastMessage("np");
                    b = man.getNewScoreboard();
                    j = b.registerNewObjective("qmc", "dummy");
                    j.setDisplaySlot(DisplaySlot.SIDEBAR);
                } else {
                    Bukkit.broadcastMessage(name.next());
                    j.setDisplayName(name.next());
                   
    
                    ScoreboardAdd.addScore(j, "&2X", "&b" + Integer.toString(x), 2,
                            1);
                    ScoreboardAdd.addScore(j, "&2Y", "&b" + Integer.toString(y), 4,
                            3);
                    ScoreboardAdd.addScore(j, "&2Z", "&b" + Integer.toString(z), 6,
                            5);
                    ScoreboardAdd.blankSpace(j, "", 7);
                    ScoreboardAdd.addScore(j, "&bLag", "&b" + Double.toString(lag)
                            + "%", 9, 8);
                    a.setScoreboard(b);
                }
            }
        }
    }
    
    But now this happens; with 1 player.

    [​IMG]

    @MaTaMoR_ Okay.. I fixed it.

    This is what I did:

    Code:
    package me.sgavster.qmc.func;
    
    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.ScoreboardAdd;
    import me.sgavster.qmc.util.Scroller;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
    
    public class scoreBoard implements Runnable, Listener {
    
        Scroller name = new Scroller(
                "&bWelcome to the &6Quadlar&2MC &bofficial server!", 30, 2, '&');
    
        public static Main m;
    
        public scoreBoard(Main main) {
            m = main;
        }
    
        ScoreboardManager man = Bukkit.getScoreboardManager();
        Scoreboard b = man.getNewScoreboard();
        Objective j;
    
        double tps = Lag.getTPS();
        double lag = Math.round((1.0D - tps / 20.0D) * 100.0D);
    
        public void run() {
    
            for (Player a : Bukkit.getOnlinePlayers()) {
                int x = a.getLocation().getBlockX();
                int y = a.getLocation().getBlockY();
                int z = a.getLocation().getBlockZ();
    
                j = b.getObjective("qmc");
    
                if (j == null) {
                    b = man.getNewScoreboard();
                    j = b.registerNewObjective("qmc", "dummy");
                    j.setDisplaySlot(DisplaySlot.SIDEBAR);
                } else {
                    j.setDisplayName(name.next());
                   
    
                    ScoreboardAdd.blankSpace(j, "&2X", x);
                    ScoreboardAdd.blankSpace(j, "&2Y", y);
                    ScoreboardAdd.blankSpace(j, "&2Z", z);
                    ScoreboardAdd.blankSpace(j, "", 3);
                    ScoreboardAdd.addScore(j, "&bLag", "&b" + Double.toString(lag)
                            + "%", 2, 1);
                    a.setScoreboard(b);
                }
            }
        }
    }
    
    It doesn't look nice, but I guess it has to do for now.

    I have only tested this with 1 player, so if it doesn't work with more I will unmark this thread as solved and ask again.

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

    MaTaMoR_

    That shouldn't work.
     
  12. Offline

    sgavster

    @MaTaMoR_ Why not? Is there anything I can do to fix it?
     
  13. Offline

    MaTaMoR_

    1 Objective for all players
     
  14. Offline

    sgavster

    @MaTaMoR_ Can I get an example? I really don't understand.
     
  15. Offline

    MaTaMoR_

    Code:java
    1.  
    2. //onJoin
    3. Scoreboard b = manager.getNewScoreboard();
    4. Objective o = b.registerNewObjective("objective", "dummy");
    5. o.setDisplaySlot(DisplaySlot.SIDEBAR);
    6. //add score blablabla
    7. player.setScoreboard(b);
    8.  
    9.  
    10. //On update
    11. Scoreboard b = player.getScoreboard();
    12. if(b != null) {
    13. Objective o = b.getObjective(DisplaySlot.SIDEBAR)
    14. Objective o = b.getObjective("objective");
    15. }
    16.  
     
  16. Offline

    sgavster

    @MaTaMoR_ Okay, that makes sense.. How about the constantly updating the scores?

    Would I just do the same, like set the score on the update but with the players board?

    EDIT: What if I used PlayerMoveEvent to update it, I could just use their scoreboard..

    EDIT 2: I tried this with 1 player, seems to work.


    Code:
    package me.sgavster.qmc.func;
    
    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.ScoreboardAdd;
    import me.sgavster.qmc.util.Scroller;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
    
    public class scoreBoard implements Listener {
    
        Scroller name = new Scroller(
                "&bWelcome to the &6Quadlar&2MC &bofficial server!", 30, 2, '&');
    
        public static Main m;
    
        public scoreBoard(Main main) {
            m = main;
        }
    
        ScoreboardManager man = Bukkit.getScoreboardManager();
        Scoreboard b = man.getNewScoreboard();
        Objective j;
    
        double tps = Lag.getTPS();
        double lag = Math.round((1.0D - tps / 20.0D) * 100.0D);
    
        @EventHandler
        public void onMove(PlayerMoveEvent e) {
            Player p = e.getPlayer();
    
            int x = p.getLocation().getBlockX();
            int y = p.getLocation().getBlockY();
            int z = p.getLocation().getBlockZ();
    
            j = b.getObjective("qmc");
    
            if (m.getConfig().getString(p.getName() + ".settings.scoreboard")
                    .equalsIgnoreCase("yes")) {
                if (j == null) {
                    b = man.getNewScoreboard();
                    j = b.registerNewObjective("qmc", "dummy");
                    j.setDisplaySlot(DisplaySlot.SIDEBAR);
                } else {
                    j.setDisplayName(name.next());
    
                    j.setDisplaySlot(DisplaySlot.SIDEBAR);
    
                    ScoreboardAdd.blankSpace(j, "&2X", x);
                    ScoreboardAdd.blankSpace(j, "&2Y", y);
                    ScoreboardAdd.blankSpace(j, "&2Z", z);
                    ScoreboardAdd.blankSpace(j, "", 3);
                    ScoreboardAdd.addScore(j, "&bLag", "&b" + Double.toString(lag)
                            + "%", 2, 1);
                    p.setScoreboard(b);
                }
            } else {
                p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
            }
        }
    }
    
     
    Last edited: Mar 11, 2015
  17. Offline

    sgavster

    @MaTaMoR_ Okay, I redid this, (sorry for double post, this is also a bump..)

    and this is my code:
    PHP:
    package me.sgavster.qmc.func;

    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import me.sgavster.qmc.util.Scroller;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Score;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;

    public class 
    scoreBoard implements Listener {

        
    Scroller name = new Scroller(
                
    "&bWelcome to the &6Quadlar&2MC &bofficial server!"302'&');

        public static 
    Main m;

        public 
    scoreBoard(Main main) {
            
    main;
        }

        
    ScoreboardManager man Bukkit.getScoreboardManager();

        
    double tps Lag.getTPS();
        
    double lag Math.round((1.0D tps 20.0D) * 100.0D);

        @
    EventHandler
        
    public void onJoin(PlayerJoinEvent e) {
            
    Scoreboard b man.getNewScoreboard();
            
    Objective o b.registerNewObjective("qmc""dummy");
            
    o.setDisplaySlot(DisplaySlot.SIDEBAR);
            
    Player p e.getPlayer();
            
    Score ol o.getScore(ChatColor.BLUE "Online: §a" Bukkit.getOnlinePlayers().size());
            
    ol.setScore(7);
            
    Score l o.getScore(ChatColor.BLUE "Level: §a" p.getLevel());
            
    l.setScore(6);
            
    Score d o.getScore(ChatColor.BLUE "Deaths: §a" m.getConfig().getInt(p.getName() + ".deaths"));
            
    d.setScore(5);
            
    Score v o.getScore(ChatColor.BLUE "Votes: §a" m.getConfig().getInt(p.getName() + ".votes"));
            
    v.setScore(4);
            
    Score x o.getScore(ChatColor.BLUE +"X: §a" p.getLocation().getBlockX());
            
    x.setScore(3);
            
    Score y o.getScore(ChatColor.BLUE +"Y: §a" p.getLocation().getBlockY());
            
    y.setScore(2);
            
    Score z o.getScore(ChatColor.BLUE +"Z: §a" p.getLocation().getBlockZ());
            
    z.setScore(1);
            
    e.getPlayer().setScoreboard(b);
        }
        @
    EventHandler
        
    public void onMove(PlayerMoveEvent e) {
            
    Player p e.getPlayer();
         
            
    Scoreboard b p.getScoreboard();

            if (
    m.getConfig().getString(p.getName() + ".settings.scoreboard")
                    .
    equalsIgnoreCase("yes")) {
                if(
    != null) {
                    
    Objective o b.getObjective("qmc");
                 
                    
    Score ol o.getScore(ChatColor.BLUE "Online: §a" Bukkit.getOnlinePlayers().size());
                    
    ol.setScore(7);
          
                    
    Score l o.getScore(ChatColor.BLUE "Level: §a" p.getLevel());
                    
    l.setScore(6);
          
                    
    Score d o.getScore(ChatColor.BLUE "Deaths: §a" m.getConfig().getInt(p.getName() + ".deaths"));
                    
    d.setScore(5);
          
                    
    Score v o.getScore(ChatColor.BLUE "Votes: §a" m.getConfig().getInt(p.getName() + ".votes"));
                    
    v.setScore(4);
          
                    
    Score x o.getScore(ChatColor.BLUE +"X: §a" p.getLocation().getBlockX());
                    
    x.setScore(3);
          
                    
    Score y o.getScore(ChatColor.BLUE +"Y: §a" p.getLocation().getBlockY());
                    
    y.setScore(2);
          
                    
    Score z o.getScore(ChatColor.BLUE +"Z: §a" p.getLocation().getBlockZ());
                    
    z.setScore(1);
          
                    
    p.setScoreboard(b);
                } else {
                    
    Scoreboard g man.getNewScoreboard();
                    
    Objective o g.registerNewObjective("qmc""dummy");
                    
    o.setDisplaySlot(DisplaySlot.SIDEBAR);
                    
    Score ol o.getScore(ChatColor.BLUE "Online: §a" Bukkit.getOnlinePlayers().size());
                    
    ol.setScore(7);
          
                    
    Score l o.getScore(ChatColor.BLUE "Level: §a" p.getLevel());
                    
    l.setScore(6);
          
                    
    Score d o.getScore(ChatColor.BLUE "Deaths: §a" m.getConfig().getInt(p.getName() + ".deaths"));
                    
    d.setScore(5);
          
                    
    Score v o.getScore(ChatColor.BLUE "Votes: §a" m.getConfig().getInt(p.getName() + ".votes"));
                    
    v.setScore(4);
          
                    
    Score x o.getScore(ChatColor.BLUE +"X: §a" p.getLocation().getBlockX());
                    
    x.setScore(3);
          
                    
    Score y o.getScore(ChatColor.BLUE +"Y: §a" p.getLocation().getBlockY());
                    
    y.setScore(2);
          
                    
    Score z o.getScore(ChatColor.BLUE +"Z: §a" p.getLocation().getBlockZ());
                    
    z.setScore(1);
                    
    e.getPlayer().setScoreboard(b);
                }
            } else {
                
    p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
            }
        }
    }
    When I log on, it works.. But it does the thing that I showed in a previous picture (shows the x a billion times..)

    I also get this error sometimes..

    [​IMG]

    When I change the config option playername.settings.scoreboard to false then turn it on it doesn't work.. What can I do?


    I think I fixed it.. Here is the final code:


    PHP:
    package me.sgavster.qmc.func;

    import me.sgavster.qmc.Main;
    import me.sgavster.qmc.util.Lag;
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Score;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;

    public class 
    scoreBoard implements Listener {

        public static 
    Main m;

        public 
    scoreBoard(Main main) {
            
    main;
        }

        
    ScoreboardManager man Bukkit.getScoreboardManager();

        
    double tps Lag.getTPS();
        
    double lag Math.round((1.0D tps 20.0D) * 100.0D);

        @
    EventHandler
        
    public void onJoin(PlayerJoinEvent e) {
            
    Scoreboard b man.getNewScoreboard();
            
    Objective o b.registerNewObjective("qmc""dummy");
            
    o.setDisplaySlot(DisplaySlot.SIDEBAR);
            
    Player p e.getPlayer();
            
    Score ol o.getScore(ChatColor.BLUE "Online: §a"
                    
    Bukkit.getOnlinePlayers().size());
            
    ol.setScore(4);

            
    Score l o.getScore(ChatColor.BLUE "Level: §a" p.getLevel());
            
    l.setScore(3);

            
    Score d o.getScore(ChatColor.BLUE "Deaths: §a"
                    
    m.getConfig().getInt(p.getName() + ".deaths"));
            
    d.setScore(2);

            
    Score v o.getScore(ChatColor.BLUE "Votes: §a"
                    
    m.getConfig().getInt(p.getName() + ".votes"));
            
    v.setScore(1);
            
    e.getPlayer().setScoreboard(b);
        }

        @
    EventHandler
        
    public void onMove(PlayerMoveEvent e) {
            
    Player p e.getPlayer();

            
    Scoreboard b p.getScoreboard();

            if (
    m.getConfig().getString(p.getName() + ".settings.scoreboard")
                    .
    equalsIgnoreCase("yes")) {
                if (
    != null) {
                    
    Objective o b.getObjective(DisplaySlot.SIDEBAR);

                    if (
    != null) {
                        
    o.setDisplayName("§6Quadular§4MC");

                        
    b.clearSlot(DisplaySlot.SIDEBAR);

                        
    o.setDisplaySlot(DisplaySlot.SIDEBAR);

                        
    Score ol o.getScore(ChatColor.BLUE "Online: §a"
                                
    Bukkit.getOnlinePlayers().size());
                        
    ol.setScore(4);

                        
    Score l o.getScore(ChatColor.BLUE "Level: §a"
                                
    p.getLevel());
                        
    l.setScore(3);

                        
    Score d o.getScore(ChatColor.BLUE "Deaths: §a"
                                
    m.getConfig().getInt(p.getName() + ".deaths"));
                        
    d.setScore(2);

                        
    Score v o.getScore(ChatColor.BLUE "Votes: §a"
                                
    m.getConfig().getInt(p.getName() + ".votes"));
                        
    v.setScore(1);

                        
    p.setScoreboard(b);
                    } else {
                        
    Scoreboard g man.getNewScoreboard();
                        
    Objective v g.registerNewObjective("qmc""dummy");
                        
    v.setDisplaySlot(DisplaySlot.SIDEBAR);
                        
    v.setDisplayName("§6Quadular§4MC");
                        
    Score ol v.getScore(ChatColor.BLUE "Online: §a"
                                
    Bukkit.getOnlinePlayers().size());
                        
    ol.setScore(4);

                        
    Score l v.getScore(ChatColor.BLUE "Level: §a"
                                
    p.getLevel());
                        
    l.setScore(3);

                        
    Score d v.getScore(ChatColor.BLUE "Deaths: §a"
                                
    m.getConfig().getInt(p.getName() + ".deaths"));
                        
    d.setScore(2);

                        
    Score i v.getScore(ChatColor.BLUE "Votes: §a"
                                
    m.getConfig().getInt(p.getName() + ".votes"));
                        
    i.setScore(1);
                        
    e.getPlayer().setScoreboard(g);
                    }
                } else {
                    
    Scoreboard g man.getNewScoreboard();
                    
    Objective o g.registerNewObjective("qmc""dummy");
                    
    o.setDisplaySlot(DisplaySlot.SIDEBAR);
                    
    o.setDisplayName("§6Quadular§4MC");
                    
    Score ol o.getScore(ChatColor.BLUE "Online: §a"
                            
    Bukkit.getOnlinePlayers().size());
                    
    ol.setScore(4);

                    
    Score l o.getScore(ChatColor.BLUE "Level: §a"
                            
    p.getLevel());
                    
    l.setScore(3);

                    
    Score d o.getScore(ChatColor.BLUE "Deaths: §a"
                            
    m.getConfig().getInt(p.getName() + ".deaths"));
                    
    d.setScore(2);

                    
    Score v o.getScore(ChatColor.BLUE "Votes: §a"
                            
    m.getConfig().getInt(p.getName() + ".votes"));
                    
    v.setScore(1);
                    
    e.getPlayer().setScoreboard(g);
                }
            } else {
                
    p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
            }
        }
    }
     
    Last edited: Mar 22, 2015
  18. Offline

    lewis_hutsby

    What buildpaths are you using?
     
  19. Offline

    sgavster

  20. Offline

    nverdier

    @sgavster He's asking what library dependencies you're using.
     
  21. Offline

    sgavster

  22. Offline

    mrCookieSlime Retired Staff

    Moved to Alternatives Section.
     
  23. Offline

    sgavster

Thread Status:
Not open for further replies.

Share This Page