jonassvensson4

!contains

Sep 3rd, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.93 KB | None | 0 0
  1.                 else if(subcmd.equalsIgnoreCase( "teamspawn" )) //eventset teamspawn
  2.                 {
  3.                    
  4.                     ConfigurationSection section = this.getConfig().getConfigurationSection( "root.teamspawn" );
  5.                     String teamspawn = args[1];
  6.                    
  7.                     if(sender.hasPermission("event.set.teamspawn") )
  8.                     {
  9.                         if(!section.contains( teamspawn )) //MR ERROR LINE########################
  10.                         {
  11.                             String world = player.getLocation().getWorld().getName();
  12.                             double x = player.getLocation().getX();
  13.                             double y = player.getLocation().getY();
  14.                             double z = player.getLocation().getZ();
  15.                             double yaw = player.getLocation().getYaw();
  16.                             double pitch = player.getLocation().getPitch();
  17.                                    
  18.                             this.getConfig().set("root.teamspawn." + args[1] + "-" + ".world", world);
  19.                             this.getConfig().set("root.teamspawn." + args[1] + "-" + ".x", x);
  20.                             this.getConfig().set("root.teamspawn." + args[1] + "-" +  ".y", y);
  21.                             this.getConfig().set("root.teamspawn." + args[1] + "-" + ".z", z);
  22.                             this.getConfig().set("root.teamspawn." + args[1] + "-" + ".yaw", yaw);
  23.                             this.getConfig().set("root.teamspawn." + args[1] + "-" + ".pitch", pitch);
  24.                                    
  25.                             this.saveConfig();
  26.                                    
  27.                             player.sendMessage(ChatColor.GOLD + "Teamspawn " + ChatColor.RED + args[1] + ChatColor.GOLD + " set!");
  28.                         }
  29.                         else
  30.                         {
  31.                             player.sendMessage(ChatColor.RED + "That teamspawn already exists!");
  32.                         }
  33.                     }
  34.                     else
  35.                     {
  36.                         player.sendMessage(ChatColor.RED + "You dont have permission");
  37.                     }
  38.                 }
Advertisement
Add Comment
Please, Sign In to add comment