1
0
mirror of https://e.coding.net/circlecloud/TeleportRandom.git synced 2024-12-25 16:28:49 +00:00

添加后台传送功能

This commit is contained in:
xjboss2 2016-03-18 10:46:22 +08:00
parent 929ac79c3d
commit e05b2118e6

View File

@ -50,7 +50,25 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
}
return true;
}
sender.sendMessage(pluginname + "§c控制台无法使用此命令!");
if(args.length>0){
try {
switch (args.length) {
case 1:
RandomTP(0,Bukkit.getPlayer(args[0]));
break;
case 2:
RandomTP(Integer.parseInt(args[1]),Bukkit.getPlayer(args[0]));
break;
case 3:
RandomTP(Integer.parseInt(args[1]),Bukkit.getWorld(args[2]),Bukkit.getPlayer(args[0]));
break;
} catch (final Exception e) {
sender.sendMessage(pluginname + "§c非法的参数或不存在的世界!");
}
}
return true;
}
sender.sendMessage(pluginname + "§c非法的参数!");
return false;
}