Worlds not picking up

Discussion in 'Plugin Development' started by AKMiner98, Dec 15, 2013.

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

    AKMiner98

    So I have this command
    Code:
    }else if(label.equalsIgnoreCase("Join")){
                if(args.length == 0){
                    if(OnlineServers.isEmpty()){
                        player.sendMessage(ChatColor.RED + "Temporarily" + ChatColor.BLUE + ", all servers are disabled or offline. Come back later!");
                    }else if(!(OnlineServers.isEmpty())){
                        player.sendMessage(ChatColor.BLUE + "The online servers are " + ChatColor.GOLD + (OnlineServers) + ChatColor.BLUE + ". Use '/Join <Server Number>' to join");
                    }
                }else if(args.length == 1){
                    if(args[0].equalsIgnoreCase("1")){
                        if(!(getServer().getWorlds().contains("Lobby1"))){
                            player.sendMessage(ChatColor.BLUE + "This is currently being worked on. It will be working soon!");
                        }else{
                            if(Server1P <= 12){
                                List<String> ls = new ArrayList<String>();
                                Server1P++;
                                Server1PL.add(player.getName());
                                player.teleport(getServer().getWorld("Lobby1").getSpawnLocation());
                                player.sendMessage(ChatColor.BLUE + "You have joined server 1");
                                player.getInventory().clear();
                                ls.add(ChatColor.RED + "Right click to pick a class!");
                                player.getInventory().addItem(setName(new ItemStack(Material.DIAMOND_SWORD), ChatColor.BLUE + "Class Picker", ls));
                                ls.clear();
                                ls.add(ChatColor.RED + "Right click to join team blue");
                                player.getInventory().addItem(setName(new ItemStack(Material.LAPIS_ORE), "Blue Team", ls));
                                ls.clear();
                                ls.add(ChatColor.RED + "Right click to join team red");
                                player.getInventory().addItem(setName(new ItemStack(Material.REDSTONE_WIRE), "Red Team", ls));
                            }else{
                                if(!(player.hasPermission("donator"))){
                                    player.sendMessage(ChatColor.BLUE + "That server is currently full, donate to premuim to join full servers");
                                }else{
                                    Server1Kick.equals(player);
                                    Server1Kick();
                                }
                            }
                        }
                    }else{
                        player.sendMessage(ChatColor.BLUE + "You must use a valid number of a online server to join it");
                    }
                }
            }
    When I do the command
    /join 1
    It is not picking up the world that it is there.
    When I remove checking if the world is there, I get this
    Code:
    [07:25:19] [Server thread/ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'join' in plugin Conquer v0.01
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192) ~[craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServer.java:542) ~[craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerConnection.java:923) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:803) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:645) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:535) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:447) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
    Caused by: java.lang.NullPointerException
        at Coding.Main.onCommand(Main.java:806) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-1.6.4-R2.0-9-g68d0e57-b2930jnks]
        ... 13 more
    [07:26:10]
    Can someone help me?

    Bump?

    It says it was caused at line 806 but line 806 is this
    Server1PL.add(player.getName());
    That has nothing with changing worlds....

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

    malandrix_bunny

    Have you made a world on your server with the exact same name?
     
  3. Offline

    AKMiner98

    I had the server create the world with the exact same name with capitals and everything that the command is searching for.

    Created the world from the plugin and it loaded and everything, but the command is still not picking up the world.

    Bump

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

    The_Doctor_123

    AKMiner98
    Please.. stop bumping so excessively..

    Show us where you defined Server1PL and the local variable player.
     
  5. Offline

    AKMiner98

    Player: Player player = (Player) sender;
    Serevr1PL: public ArrayList<String> Server1PL = new ArrayList<String>();
     
  6. Offline

    AKMiner98

    Last time I am bumping, then I am ditching the thread
     
Thread Status:
Not open for further replies.

Share This Page