1
0
mirror of https://e.coding.net/circlecloud/TeleportRandom.git synced 2024-11-01 07:38:47 +00:00

feat: 修复reload和help命令

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-07-20 14:42:42 +08:00
parent dc133a01f0
commit 74edabcf86

View File

@ -36,29 +36,25 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
switch (args.length) {
case 0:
randomTP(0, p.getWorld(), p);
break;
return true;
case 1:
randomTP(Integer.parseInt(args[0]), p.getWorld(), p);
break;
return true;
case 2:
randomTP(Integer.parseInt(args[0]), Bukkit.getWorld(args[1]), p);
break;
}
return true;
}
} else if (args.length > 1) {
final Player p = Bukkit.getPlayer(args[0]);
switch (args.length) {
case 2:
randomTP(Integer.parseInt(args[1]), p.getWorld(), p);
break;
return true;
case 3:
randomTP(Integer.parseInt(args[1]), Bukkit.getWorld(args[2]), p);
break;
default:
break;
}
}
return true;
}
}
} catch (final IllegalArgumentException e) {
sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!");
}