update Scoreboard

Discussion in 'Plugin Development' started by pvtr_, Jan 12, 2020.

  1. Offline

    pvtr_

    Hello, I have a problem that I can't deal with and I ask for help, I do tabliste under 1.8 and everything works, it only generates a mistake that I can't handle ...

    Code:
    [15:50:20 WARN]: [eCORE] Task #28 for eCORE v1.2-SNAPSHOT generated an exception
    java.lang.NullPointerException
            at com.gmail.neex.tab.element.Sidebar.globalUpdate(Sidebar.java:223) ~[?:?]
            at com.gmail.neex.tab.element.ScoreboardStack.run(ScoreboardStack.java:31) ~[?:?]
            at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
    
    Sidebar
    Code:
        public void update() {
            final Scoreboard sb = this.user.getScoreboard();
            if (sb == null) {
                return;
            }
            final Objective ob = sb.getObjective("SIDEBAR");
            if (!SettingsConfig.SIDEBAR_ENABLE || this.disabled) {
                if (ob != null) {
                    ob.unregister();
                }
                return;
            }
            if (ob == null) {
                this.create();
            }
            this.replace();
            this.split();
            final String[] scheme = Scheme.getInst().getSchemeSidebar();
            for (int i = 0; i < this.ss.length; ++i) {
                Team team = sb.getTeam(scheme[i]);
                if (team == null) {
                    team = sb.registerNewTeam(scheme[i]);
                    team.addPlayer((OfflinePlayer)new OfflineUser(scheme[i]));
                }
                team.setPrefix((this.prefix[i] == null) ? "" : this.prefix[i]);
                team.setSuffix((this.suffix[i] == null) ? "" : this.suffix[i]);
            }
        }
    
        public static void globalUpdate() {
            for (final User user : UserManager.getOnline()) {
                user.getSidebar().update();
                user.setScoreboard(user.getScoreboard());
                user.getScoreboard();
                user.getPlayer().getScoreboard();
                user.getPlayer().setScoreboard(user.getPlayer().getScoreboard());
                user.getPlayer().setScoreboard(user.getScoreboard());
                user.getSidebar();
                user.getSidebar().update();
    
    ScoreboardStack
    Code:
        public void run() {
            this.fill();
            Sidebar.globalUpdate();
        }
    
     

Share This Page