Util ScoreboardManager - Sidebar handling made easier!

Discussion in 'Resources' started by megamichiel, Jul 4, 2015.

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

    DeathZonePT

    @Krumb069
    Stacktrace?

    @Krumb069
    StackTrace?

    EDIT: ignore this post

    @Krumb069
    this Util class is for 1.8+ does not for in 1.7.10

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  2. Offline

    jebbo

    Line 287:
    'String pkg = Bukkit.getServer().getClass().getPackage().getSimpleName();'

    'The method getSimpleName() is undefined for the type Package'

    What to do?
     
  3. Offline

    Krumb069

    Edit:1.7 supported fixed on new code
     
    Last edited: Jul 9, 2015
  4. Offline

    jebbo

    I got it to work now but the scores show multiple times:
    [​IMG]

    Does anybody have a solution to this?
     
  5. Offline

    DeathZonePT

    @Krumb069
    Well is in the class say's 1.8 not 1.7/1.8

    @jebbo
    Change to this String pkg = Bukkit.getServer().getClass().getPackage().getName();

    Show me your class

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  6. Offline

    jebbo

    @DeathZonePT
    I updated it a bit, but still the same, the scores that change get duplicated.

    Code:
    public void refreshScoreboard(){
            SScoreboard sb;
            if(SScoreboard.getManager().getScoreboard(this) == null){
                sb = SScoreboard.getManager().setupBoard(this);
            }else{
                sb = SScoreboard.getManager().getScoreboard(this);
            }
            sb.setHeader("§6§lServerName").update();
            sb.setScores(
                    "§e ",
                    "§6§lKills: ",
                    "§e§r ",
                    "§c§7➤ §a"+getKills(),
                    "§6§lTode: ",
                    "§e§f ",
                    "§a§7➤ §a"+getDeaths(),
                    "§6§lCoins: ",
                    "§e§4 ",
                    "§2§7➤ §a"+getCoins(),
                    "§e§1 ",
                    "§6§lRang: ",
                    "§e§5 ",
                    "§1§7➤ §a"+getRang()).update();
        }
     
    Last edited: Jul 8, 2015
  7. Offline

    DeathZonePT

    @jebbo
    Make a array list string
     
  8. Offline

    megamichiel

    @jebbo
    You're calling "this", which means the class your calling it from implements Player. That will probably not work, only call it on real bukkit players obtained from events/bukkit's methods
    @DeathZonePT
    They don't have to be a list. setScores(String[] scores) Basicly just calls setScores(Arrays.asList(scores));

    @Krumb069
    If there's a stacktrace in your console, would you mind sending it? If not, would you mind sending your Scoreboard class so I could maybe have a look at what's wrong. If you're sending the Scoreboard class, for the sake of everyone's eyes, send it through something like pastebin please.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  9. Offline

    Krumb069

    Edit:1.7 supported fixed on new code
     
    Last edited: Jul 9, 2015
  10. Offline

    DeathZonePT

    @Krumb069
    Bro this class is only for 1.8!!! this will not work in 1.7.10
     
  11. Offline

    megamichiel

    @Krumb069
    Ah, I see, thank you. I will work on it and when it's done I'll notify you and the updated source will be in the link
     
    Krumb069 and DeathZonePT like this.
  12. Offline

    Krumb069

    Edit:1.7 supported fixed on new code
     
    Last edited: Jul 9, 2015
  13. Offline

    megamichiel

    @Krumb069
    Updated the link, untested, but should work.
     
  14. Offline

    Krumb069

  15. Offline

    jebbo

    @megamichiel

    Thanks for your reply, I tried it with 'p' now, a normal Bukkit Player.

    Same result: [​IMG]

    Any ideas? :)

    Thanks.
     
  16. Offline

    Krumb069

    I cannot set board header it sets it always "Board"
    console errors:
    Code:
    java.lang.ArrayIndexOutOfBoundsException: 3
    [11:30:11] [Server thread/WARN]:     at com.barbargaming.skortahtasi.Scoreboard.update(Scoreboard.java:143)
    [11:30:11] [Server thread/WARN]:     at com.barbargaming.skortahtasi.Main$1.run(Main.java:30)
    [11:30:11] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71)
    [11:30:11] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [11:30:11] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:641)
    [11:30:11] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
    [11:30:11] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    [11:30:11] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    [11:30:11] [Server thread/WARN]:     at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
    anyway, I will switch to 1.8
     
  17. Offline

    megamichiel

    @Krumb069
    Updated the source, was a small mistake I made. Should be fixed now.
    @jebbo @The__Master_Coder
    I think I know the place where it's not working, but I'm not sure what part is making it not work properly.
     
    Krumb069 likes this.
  18. @megamichiel Okay, thanks, just need a way to remove the old score name, to add the new one
     
  19. Offline

    DeathZonePT

    @megamichiel
    i my scoreboard also is to multiply my scores , and the reason for this is that scoreboard is not updating properly

    Sorry for my bad inglesh :p

    @megamichiel
    Please help me the score does not want to update!!

    Code:
    package com.DeathZone.Listener;
    
    import java.util.Arrays;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerChangedWorldEvent;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerQuitEvent;
    import org.bukkit.scheduler.BukkitRunnable;
    
    import com.DeathZone.Core;
    import com.DeathZone.Scoreboard;
    
    public class ScoreBoardListener implements Listener {
       
        private Core plugin;
       
        public ScoreBoardListener(Core plugin) {
            this.plugin = plugin;
        }
       
       
        private static final List<String> frames = Arrays.asList(
                "§4§lDeathZone",
                "§c§lD§4§leathZone",
                "§f§lD§c§le§4§lathZone",
                "§c§lD§f§le§c§la§4§lthZone",
                "§4§lD§c§le§f§la§c§lt§4§lhZone",
                "§4§lDe§c§la§f§lt§c§lh§4§lZone",
                "§4§lDea§c§lt§f§lh§c§lZ§4§lone",
                "§4§lDeat§c§lh§f§lZ§c§lo§4§lne",
                "§4§lDeath§c§lZ§f§lo§c§ln§4§le",
                "§4§lDeathZ§c§lo§f§ln§c§le",
                "§4§lDeathZo§c§ln§f§le",
                "§4§lDeathZon§c§le",
                "§4§lDeathZone");
    
        private static final Map<String, Integer> taskIds = new HashMap<>();
    
        @EventHandler
        public void onJoin(PlayerJoinEvent e) {
           
            final Player p = (Player) e.getPlayer();
           
            @SuppressWarnings("deprecation")
            final List<String> scores = Arrays.asList(
                    "§1",
                    "§7Player",
                    "§a" + p.getName(),
                    "§a",
                    "§7Rank",
                    "§a" + plugin.perm.getPrimaryGroup(p),
                    "§2",
                    "§7Money",
                    "§a$" + plugin.econ.getBalance(p.getName()),
                    "§b",
                    "§7Online",
                    "§a" + Bukkit.getOnlinePlayers().size() + "/300",
                    "§c",
                    "§7Website",
                    "§ahttp://deathzone.ml");
           
            final Scoreboard board = Scoreboard.getManager().setupBoard(p);
           
            if (board != null) {
               
                board.setHeader(frames.get(0)).update();
                   
                   
                taskIds.put(p.getName(), new BukkitRunnable() {
                    int frame = 0;
                    public void run() {
                       
                        board.setScores(scores).update();
                       
                        frame++;
                        if (frame == frames.size()) {
                            frame = 0;
                        }
                        board.setHeader(frames.get(frame)).update();
                    }
                }.runTaskTimer(plugin, 0L, 2L).getTaskId());
            }   
        }
       
        @EventHandler
        public void onWorldChanged(PlayerChangedWorldEvent e) {
            Player p = (Player) e.getPlayer();
           
            final Scoreboard board = Scoreboard.getManager().getScoreboard(p);
           
            if (!e.getPlayer().getWorld().getName().equals("world")) {
                board.setScores(new String[0]);
                board.unregister();
                Integer id = taskIds.remove(e.getPlayer().getName());
                if (id != null) {
                    plugin.getServer().getScheduler().cancelTask(id);
                }
                return;
            } else {
                board.update();
            }
        }
       
    
        @EventHandler
        public void onQuit(PlayerQuitEvent e) {
           
            Integer id = taskIds.remove(e.getPlayer().getName());
            if (id != null) {
                plugin.getServer().getScheduler().cancelTask(id);
            }
        }
    }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  20. Offline

    Krumb069

    @megamichiel
    I switched my server to. 1.7. again and title isnt fixed
     
  21. Offline

    davidmanassa

  22. Offline

    Krumb069

    @davidmanassa
    I don't know

    @megamichiel
    can you add support for adding below name and tag to players ? (I don't understand about scoreboards)
     
  23. Offline

    megamichiel

    @davidmanassa
    I'm still searching for the solution, I'm sorry for this.
     
    DeathZonePT likes this.
  24. Offline

    DeathZonePT

    @davidmanassa
    Yeah but mine just stays the same i have to leave the server and rejoin to the scoreboard update
     
  25. Offline

    DeathZonePT

    I have this error now!
    Code:
    [18:35:21 WARN]: java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftObjective.getHandle()
    [18:35:21 WARN]:        at java.lang.Class.getMethod(Unknown Source)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard$ReflectUtil.getHandle(Scoreboard.java:347)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:232)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard$ScoreboardManager.access$1(Scoreboard.java:231)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard.update(Scoreboard.java:115)
    [18:35:22 WARN]:        at com.DeathZone.Listeners.ScoreBoardListener$2.run(ScoreBoardListener.java:95)
    [18:35:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
    [18:35:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:722)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:653)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:556)
    [18:35:22 WARN]:        at java.lang.Thread.run(Unknown Source)
    [18:35:22 WARN]: java.lang.reflect.InvocationTargetException
    [18:35:22 WARN]:        at sun.reflect.GeneratedConstructorAccessor32.newInstance(Unknown Source)
    [18:35:22 WARN]:        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    [18:35:22 WARN]:        at java.lang.reflect.Constructor.newInstance(Unknown Source)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:238)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard$ScoreboardManager.access$1(Scoreboard.java:231)
    [18:35:22 WARN]:        at com.DeathZone.ScoreBoard.Scoreboard.update(Scoreboard.java:115)
    [18:35:22 WARN]:        at com.DeathZone.Listeners.ScoreBoardListener$2.run(ScoreBoardListener.java:95)
    [18:35:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
    [18:35:22 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:722)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:653)
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:556)
    [18:35:22 WARN]:        at java.lang.Thread.run(Unknown Source)
    [18:35:22 WARN]: Caused by: java.lang.NullPointerException
    [18:35:22 WARN]:        at net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardScore.<init>(SourceFile:37)
    [18:35:22 WARN]:        ... 14 more
    
    
     
  26. Offline

    DeathZonePT

    @megamichiel
    ok your class now show me this error please fix it :)
    i try 1.8 and 1.8.3

    Code:
    [20:46:02] [Server thread/WARN]: java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_8_R1.scoreboard.CraftObjective.getHandle()
    [20:46:02] [Server thread/WARN]:     at java.lang.Class.getMethod(Unknown Source)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard$ReflectUtil.getHandle(Scoreboard.java:347)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:232)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard$ScoreboardManager.access$1(Scoreboard.java:231)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard.update(Scoreboard.java:115)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Listeners.TestListener$2.run(TestListener.java:95)
    [20:46:02] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java:71)
    [20:46:02] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:709)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537)
    [20:46:02] [Server thread/WARN]:     at java.lang.Thread.run(Unknown Source)
    [20:46:02] [Server thread/WARN]: java.lang.reflect.InvocationTargetException
    [20:46:02] [Server thread/WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [20:46:02] [Server thread/WARN]:     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    [20:46:02] [Server thread/WARN]:     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    [20:46:02] [Server thread/WARN]:     at java.lang.reflect.Constructor.newInstance(Unknown Source)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:238)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard$ScoreboardManager.access$1(Scoreboard.java:231)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Utils.Scoreboard.Scoreboard.update(Scoreboard.java:115)
    [20:46:02] [Server thread/WARN]:     at com.DeathZone.Listeners.TestListener$2.run(TestListener.java:95)
    [20:46:02] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java:71)
    [20:46:02] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:709)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634)
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537)
    [20:46:02] [Server thread/WARN]:     at java.lang.Thread.run(Unknown Source)
    [20:46:02] [Server thread/WARN]: Caused by: java.lang.NullPointerException
    [20:46:02] [Server thread/WARN]:     at net.minecraft.server.v1_8_R1.PacketPlayOutScoreboardScore.<init>(SourceFile:37)
    [20:46:02] [Server thread/WARN]:     ... 15 more
    My class
    Code:
    package com.DeathZone.Listeners;
    import java.util.Arrays;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    
    import org.bukkit.Bukkit;
    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.PlayerQuitEvent;
    import org.bukkit.scheduler.BukkitRunnable;
    
    import com.DeathZone.Core;
    import com.DeathZone.Utils.Scoreboard.Scoreboard;
    public class TestListener implements Listener {
      
        private Core plugin;
      
        public TestListener(Core plugin) {
            this.plugin = plugin;
        }
        private Map<String, Integer> taskIds = new HashMap<>();
        @EventHandler
        public void onJoin(PlayerJoinEvent e) {
          
            final Player p = (Player) e.getPlayer();
          
            final Scoreboard board = Scoreboard.getManager().setupBoard(p);
          
            if (board != null) {
               
                List<String> frames = Arrays.asList(
                        "§4§lDeathZone",
                        "§c§lD§4§leathZone",
                        "§f§lD§c§le§4§lathZone",
                        "§c§lD§f§le§c§la§4§lthZone",
                        "§4§lD§c§le§f§la§c§lt§4§lhZone",
                        "§4§lDe§c§la§f§lt§c§lh§4§lZone",
                        "§4§lDea§c§lt§f§lh§c§lZ§4§lone",
                        "§4§lDeat§c§lh§f§lZ§c§lo§4§lne",
                        "§4§lDeath§c§lZ§f§lo§c§ln§4§le",
                        "§4§lDeathZ§c§lo§f§ln§c§le",
                        "§4§lDeathZo§c§ln§f§le",
                        "§4§lDeathZon§c§le",
                        "§4§lDeathZone");
              
                board.setHeader(frames.get(0)).update();        
                  
                taskIds.put(p.getName(), new BukkitRunnable() {
                    int frame = 0;
                    public void run() {
                        frame++;
                        if (frame == frames.size()) {
                            frame = 0;
                        }
                        board.setHeader(frames.get(frame)).update();
                    }
                }.runTaskTimer(plugin, 0, 2).getTaskId());
            }      
            update(p);
        }
       
        public void update(final Player p) {
            Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
               
                @Override
                public void run() {
                    Scoreboard board = Scoreboard.getManager().getScoreboard(p);
                   
                    if (board != null) {
                        List<String> score = Arrays.asList(
                                "§1",
                                "§7Player",
                                "§a" + p.getName(),
                                "§a",
                                "§7Faction",
                                "§a" + plugin.factions.getFaction(p),
                                "§2",
                                "§7DTR",
                                "§a" + plugin.factions.getFacDTR(p) + "§7/§a" + plugin.factions.getFacDTRMax(p),
                                "§b",
                                "§7Faction Members",
                                "§a" + plugin.factions.getOnlineFactionMembers(p) + "§7/§a" + plugin.factions.getFactionMembers(p),
                                "§c",
                                "§7Website",
                                "§ahttp://deathzone.ml");
                   
                        board.setScores(score).update();
                    }       
                }
            }, 0, 1 * 20);
        }
        @EventHandler
        public void onQuit(PlayerQuitEvent e) {
          
            Integer id = taskIds.remove(e.getPlayer().getName());
            if (id != null) {
                plugin.getServer().getScheduler().cancelTask(id);
            }
        }
    }
     
  27. Offline

    DispenserLP

    #Update plz :p
     
  28. Offline

    natsimhan

    @megamichiel Im having the same problem @jebbo and @The__Master_Coder

    My Spigot version is
    CraftBukkit version git-Spigot-5f38d38-18fbb24 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)

    I see exactly same as @jebbo picture
    And I have this errors in console :
    Code:
    [22:48:44 WARN]: java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftObjective.getHandle()
    [22:48:44 WARN]:        at java.lang.Class.getMethod(Class.java:1786)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard$ReflectUtil.getHandle(Scoreboard.java:374)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:256)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard$ScoreboardManager.access$100(Scoreboard.java:181)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard.update(Scoreboard.java:130)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.FarmerTimer.run(FarmerTimer.java:125)
    [22:48:44 WARN]: java.lang.reflect.InvocationTargetException
    [22:48:44 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    [22:48:44 WARN]:        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    [22:48:44 WARN]:        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    [22:48:44 WARN]:        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard$ScoreboardManager.getRemovePacket(Scoreboard.java:262)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard$ScoreboardManager.access$100(Scoreboard.java:181)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.Scoreboard.update(Scoreboard.java:130)
    [22:48:44 WARN]:        at com.natsimhan.minecraft.FarmerTimer.run(FarmerTimer.java:125)
    [22:48:44 WARN]: Caused by: java.lang.NullPointerException
    [22:48:44 WARN]:        at net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardScore.<init>(SourceFile:37)
    [22:48:44 WARN]:        ... 8 more
    
     
  29. Offline

    Zombie_Striker

    This is your issue. It's not compattable with 1.8.8

    @megamichiel
    Change your code so it will look like the following:
    Code:
    String MinecraftVers = //Get the server's version
    getClass("net.minecraft.server."+MinecraftVers+".PacketPlayOutScoreboardScore')
     
Thread Status:
Not open for further replies.

Share This Page