NullPointerException Error Help

Discussion in 'Plugin Development' started by VinexAx789, Mar 7, 2016.

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

    VinexAx789

    Code:
    package com.rektwarfare.dtp.game;
    
    import java.util.ArrayList;
    import java.util.Random;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Color;
    import org.bukkit.FireworkEffect;
    import org.bukkit.FireworkEffect.Type;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Firework;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.inventory.meta.FireworkMeta;
    import org.bukkit.scheduler.BukkitRunnable;
    import org.bukkit.scoreboard.DisplaySlot;
    
    import com.rektwarfare.dtp.DTP;
    import com.rektwarfare.dtp.DTP.GameState;
    import com.rektwarfare.dtp.timer.GameEndTimer;
    import com.rektwarfare.dtp.utils.TabUtils;
    
    public class EndGame implements Listener {
    
        public DTP plugin;
        private GameEndTimer endTimer = new GameEndTimer(plugin, 0);
    
        public EndGame(DTP plugin) {
            this.plugin = plugin;
        }
    
        @SuppressWarnings({ "deprecation", "static-access" })
        public void gameOver(int winner) {
            plugin.gstate = GameState.ENDED;
            // plugin.setEnded(true);
            // plugin.isEnded();
            ArrayList<String> winners;
            ArrayList<String> losers;
    
            Color color;
            switch (winner) {
            case 0: // ATTACKERS WON
                winners = plugin.attackersPlayerWins; // Null Pointer Here.
                losers = plugin.defendersPlayerWins;
                Bukkit.broadcastMessage(ChatColor.RED.toString() + ChatColor.BOLD.toString() + "Attackers win!");
                endTimer.runTaskTimer(plugin, 20L, 20L).cancel();
                for (Player player : Bukkit.getOnlinePlayers()) {
                    TabUtils.sendTitle(player, 10, 10, 10, ChatColor.RED + "" + ChatColor.BOLD + "Attackers win!");
                }
                color = Color.RED;
                break;
            case 1: // DEFENDERS WON
                Bukkit.broadcastMessage(ChatColor.BLUE.toString() + ChatColor.BOLD.toString() + "Defenders win!");
                endTimer.runTaskTimer(plugin, 20L, 20L).cancel();
                winners = plugin.defendersPlayerWins;
                losers = plugin.attackersPlayerWins;
                for (Player player : Bukkit.getOnlinePlayers()) {
                    TabUtils.sendTitle(player, 10, 10, 10, ChatColor.BLUE + "" + ChatColor.BOLD + "Defenders win!");
                }
                color = Color.BLUE;
                break;
            default:
                Bukkit.broadcastMessage(ChatColor.GREEN.toString() + ChatColor.BOLD.toString() + "The game is a draw!");
                winners = new ArrayList<String>();
                losers = new ArrayList<String>();
                Bukkit.broadcastMessage("§9§k00 §e§lDraw §9§k00");
                endTimer.runTaskTimer(plugin, 20L, 20L).cancel();
                for (Player player : Bukkit.getOnlinePlayers()) {
                    TabUtils.sendTitle(player, 10, 10, 10, "§9§k00 §e§lDraw §9§k00");
                    plugin.econ.depositPlayer(player, 5.0);
                    player.sendMessage(plugin.prefix + "5 coins we're added to your account drawing!");
                }
                color = Color.GREEN;
                break;
            }
            losers.removeAll(winners);
    
            for (String p : winners) {
                Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Winner reward: 10 coins!");
                plugin.econ.depositPlayer(Bukkit.getPlayer(p), 10.0);
                if (Bukkit.getPlayer(p).hasPermission("dtp.warrior.coins")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Warrior reward: 12 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 12.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.elite.coins")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Elite reward: 14 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 14.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.legend.coins")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Legend reward: 16 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 16.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.veteran.coins")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Veteran reward: 18 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 18.0);
                }
            }
            for (String p : losers) {
                Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Loser reward: 5 coins!");
                plugin.econ.depositPlayer(Bukkit.getPlayer(p), 5.0);
                if (Bukkit.getPlayer(p).hasPermission("dtp.warrior.coins.loss")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Warrior reward: 7 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 7.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.elite.coins.loss")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Elite reward: 9 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 9.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.legend.coins.loss")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Legend reward: 11 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 11.0);
                } else if (Bukkit.getPlayer(p).hasPermission("dtp.veteran.coins.loss")) {
                    Bukkit.getPlayer(p).sendMessage(plugin.prefix + "Veteran reward: 13 coins!");
                    plugin.econ.depositPlayer(Bukkit.getPlayer(p), 13.0);
                }
            }
    
            new BukkitRunnable() {
                int counter = 8;
    
                public void run() {
                    counter = counter - 1;
                    Random r = new Random();
                    for (Player p : plugin.players) {
                        if (p.isOnline()) {
                            p.getScoreboard().clearSlot(DisplaySlot.SIDEBAR);
                            Firework fw = (Firework) p.getWorld().spawnEntity(p.getLocation(), EntityType.FIREWORK);
                            FireworkMeta fwm = fw.getFireworkMeta();
                            int rt = r.nextInt(4) + 1;
                            Type type = Type.BALL;
                            if (rt == 1)
                                type = Type.BALL;
                            if (rt == 2)
                                type = Type.BALL_LARGE;
                            if (rt == 3)
                                type = Type.BURST;
                            if (rt == 4)
                                type = Type.CREEPER;
                            if (rt == 5)
                                type = Type.STAR;
                            FireworkEffect effect = FireworkEffect.builder().flicker(r.nextBoolean()).withColor(color)
                                    .withFade(color).with(type).trail(r.nextBoolean()).build();
                            fwm.addEffect(effect);
                            int rp = r.nextInt(2) + 1;
                            fwm.setPower(rp);
                            fw.setFireworkMeta(fwm);
                        }
                    }
                    if (counter == 0) {
                        cancel();
                    }
    
                }
            };
    
            plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                public void run() {
                    for (Player p : Bukkit.getOnlinePlayers()) {
                        winners.remove(p.getName());
                        losers.remove(p.getName());
                        p.kickPlayer(ChatColor.YELLOW + "Thank you for playing" + ChatColor.RED + ChatColor.BOLD + " DTP-1"
                                + ChatColor.YELLOW + " on " + ChatColor.RED + ChatColor.BOLD + "RektWarfare! "
                                + ChatColor.YELLOW + "\nServer Restarting. This may take up to " + ChatColor.RED
                                + ChatColor.BOLD + "10 seconds.\n " + ChatColor.YELLOW + "Visit our website @ "
                                + ChatColor.RED + ChatColor.BOLD + "www.RektWarfare.com");
                    }
                }
            }, 200L);
            plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                public void run() {
                    Bukkit.getServer().unloadWorld(plugin.attackerspawn.getWorld(), false);
                }
            }, 220L);
            plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                public void run() {
                    Bukkit.getServer().reload();
                }
            }, 230L);
        }
    }
    The ArrayList.
    Code:
        public ArrayList<String> attackersPlayerWins = new ArrayList<String>();
    STACKTRACE:

    Code:
    07.03 17:59:40 [Server] ERROR Could not pass event PlayerDeathEvent to DTP v1.0 07.03 17:59:40 [Server] INFO org.bukkit.event.EventException 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:396) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.die(EntityPlayer.java:417) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityLiving.damageEntity(EntityLiving.java:812) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.damageEntity(EntityHuman.java:800) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.damageEntity(EntityPlayer.java:496) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.attack(EntityHuman.java:1001) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.attack(EntityPlayer.java:1063) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1355) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:52) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:11) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO Caused by: java.lang.NullPointerException 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.game.EndGame.gameOver(EndGame.java:44) ~[?:?] 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.events.DeathEvents.onDeathEvents(DeathEvents.java:60) ~[?:?] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO ... 22 more
    LINE 44:
    Code:
    winners = plugin.attackersPlayerWins;
    LINE 60:
    Code:
    endGame.gameOver(0);
     
    Last edited: Mar 7, 2016
  2. Offline

    Scorpionvssub

    a stacktrace would be helpfull aswell in pastebin.com

    Edit did you ever initialize the arraylist with <var> = new Arraylist?
     
  3. Offline

    VinexAx789

    @Scorpionvssub One sec

    STACKTRACE:

    Code:
    07.03 17:59:40 [Server] ERROR Could not pass event PlayerDeathEvent to DTP v1.0 07.03 17:59:40 [Server] INFO org.bukkit.event.EventException 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:396) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.die(EntityPlayer.java:417) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityLiving.damageEntity(EntityLiving.java:812) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.damageEntity(EntityHuman.java:800) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.damageEntity(EntityPlayer.java:496) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.attack(EntityHuman.java:1001) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.attack(EntityPlayer.java:1063) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1355) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:52) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:11) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO Caused by: java.lang.NullPointerException 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.game.EndGame.gameOver(EndGame.java:44) ~[?:?] 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.events.DeathEvents.onDeathEvents(DeathEvents.java:60) ~[?:?] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO ... 22 more
    
    LINE 44:
    Code:
    winners = plugin.attackersPlayerWins;
    LINE 60:
    Code:
    endGame.gameOver(0);
     
    Last edited: Mar 7, 2016
  4. Offline

    Scorpionvssub

    Try a system output on the arraylist System.out.println(attackerPlayerswins); see if it returns null, if null its either never initialized or even filled
     
  5. Offline

    VinexAx789

  6. Offline

    Scorpionvssub

    INFO at com.rektwarfare.dtp.events.DeathEvents.onDeathEvents(DeathEvents.java:60)
     
  7. Offline

    VinexAx789

  8. Offline

    Scorpionvssub

    show the "endgame" setup and death event include line 60
     
  9. Offline

    VinexAx789

    @Scorpionvssub Ok. BTW it printed the players in it so it's not null: 07.03 18:07:52 [Server] INFO [Vinex_, Cloudwhale]
     
  10. Offline

    Scorpionvssub

    and what is the gameover(0); supposed to mean
     
  11. Offline

    VinexAx789

  12. Offline

    Scorpionvssub

    hmm only thing i can think of so fast is checking if both vars winner/loser/<all player related vars> if they are filled when they should be filled 1 of em has to be empty else im not sure what the issue is
     
  13. Offline

    VinexAx789

  14. Offline

    Scorpionvssub

    Last solution that i can give you:

    System output all vars that are related to players see if they are filled
    Make sure every var that is new to the plugin at first so first initialized is <var> = new ArrayList<>();

    it better spam the console for now and see an issue and making sure its accually filled than not, cause a nullpointer only means something is not being filled properly
     
  15. Offline

    VinexAx789

    @Scorpionvssub They are set = new ArrayList<>(); I tested the lists and they're all working what the hell is Null.
     
  16. Offline

    Scorpionvssub

    another question: Why is gameover for winner 0 shouldn't it be higher?
     
  17. Offline

    VinexAx789

  18. Offline

    WolfMage1

    StackTrace (open)
    07.03 17:59:40 [Server] ERROR Could not pass event PlayerDeathEvent to DTP v1.0 07.03 17:59:40 [Server] INFO org.bukkit.event.EventException 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:396) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.die(EntityPlayer.java:417) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityLiving.damageEntity(EntityLiving.java:812) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.damageEntity(EntityHuman.java:800) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.damageEntity(EntityPlayer.java:496) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityHuman.attack(EntityHuman.java:1001) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.EntityPlayer.attack(EntityPlayer.java:1063) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1355) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:52) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.a(SourceFile:11) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66] 07.03 17:59:40 [Server] INFO Caused by: java.lang.NullPointerException 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.game.EndGame.gameOver(EndGame.java:44) ~[?:?] 07.03 17:59:40 [Server] INFO at com.rektwarfare.dtp.events.DeathEvents.onDeathEvents(DeathEvents.java:60) ~[?:?] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66] 07.03 17:59:40 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot45.jar:git-Spigot-5f38d38-12698ea] 07.03 17:59:40 [Server] INFO ... 22 more


    @VinexAx789 So people can read it easier.
     
  19. Offline

    VinexAx789

    @WolfMage1 Yeah it was glitched. Spigot people say the plugin variable is null.
     
  20. Offline

    Zombie_Striker

    @VinexAx789
    Code:
    [?:1.8.0_66] 07.03 17:59:40 [Server] INFO Caused by: java.lang.NullPointerException 07.03 17:59:40
    [Server] INFO at com.rektwarfare.dtp.game.EndGame.gameOver(EndGame.java:44)
    Something is null on line 44 of EndGameClass. The two classes you posted did not have the packages, nor the imports, so I cannot know what line 44 is exactly.

    Please post line either the full class, or simply post line 44.
     
  21. Offline

    WolfMage1

    Read the full post :p
     
    VinexAx789 likes this.
  22. Offline

    VinexAx789

  23. Offline

    mythbusterma

    @VinexAx789

    Plugin is null. Also you really need to clean up this code. Like badly.
     
  24. Offline

    WolfMage1

    Could you describe for @VinexAx789 how he should clean it up?
     
  25. Offline

    mythbusterma

    I don't really know how. I think he just needs to start over. For example, what is this line supposed to mean?

    winners = plugin.attackersPlayerWins

    This implies that there's a list representing the attackers if they win, and another if they lose. It seems like he's gone to great lengths to avoid having to create a class representing teams, which really would have been the way to do this.
     
    WolfMage1 likes this.
  26. Offline

    VinexAx789

Thread Status:
Not open for further replies.

Share This Page