jonassvensson4

command config

Jul 8th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. if( commandLabel.equalsIgnoreCase( "setarena" ) )
  2.            
  3.             if(sender.hasPermission("event.setarena") ) {
  4.                
  5.                 if(args.length == 1) {
  6.                    
  7.                 String world = player.getLocation().getWorld().getName();
  8.                 double x = player.getLocation().getX();
  9.                 double y = player.getLocation().getY();
  10.                 double z = player.getLocation().getZ();
  11.                
  12.                 this.getConfig().set(args[0] + "-arena.world", world);
  13.                 this.getConfig().set(args[0] + "-arena.x", x);
  14.                 this.getConfig().set(args[0] + "-arena.y", y);
  15.                 this.getConfig().set(args[0] + "-arena.z", z);
  16.                
  17.                 this.saveConfig();
  18.                
  19.                 player.sendMessage(ChatColor.GOLD + "Arena "+ ChatColor.RED + args[0] + ChatColor.GOLD + " set!");
  20.                 }
  21.                 if(args.length == 0) {
  22.  
  23.                     player.sendMessage(ChatColor.RED + "Usage:" + ChatColor.GOLD + "/setarena" + ChatColor.RED + "<Name>");
  24.                 }
  25.                
  26.             }else{
  27.                 player.sendMessage(ChatColor.RED + "You dont have permission");
  28.             }
Advertisement
Add Comment
Please, Sign In to add comment