1
0
mirror of https://e.coding.net/circlecloud/TeleportRandom.git synced 2024-12-26 16:38:49 +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) { switch (args.length) {
case 0: case 0:
randomTP(0, p.getWorld(), p); randomTP(0, p.getWorld(), p);
break; return true;
case 1: case 1:
randomTP(Integer.parseInt(args[0]), p.getWorld(), p); randomTP(Integer.parseInt(args[0]), p.getWorld(), p);
break; return true;
case 2: case 2:
randomTP(Integer.parseInt(args[0]), Bukkit.getWorld(args[1]), p); randomTP(Integer.parseInt(args[0]), Bukkit.getWorld(args[1]), p);
break; return true;
} }
return true;
} else if (args.length > 1) { } else if (args.length > 1) {
final Player p = Bukkit.getPlayer(args[0]); final Player p = Bukkit.getPlayer(args[0]);
switch (args.length) { switch (args.length) {
case 2: case 2:
randomTP(Integer.parseInt(args[1]), p.getWorld(), p); randomTP(Integer.parseInt(args[1]), p.getWorld(), p);
break; return true;
case 3: case 3:
randomTP(Integer.parseInt(args[1]), Bukkit.getWorld(args[2]), p); randomTP(Integer.parseInt(args[1]), Bukkit.getWorld(args[2]), p);
break; return true;
default:
break;
} }
} }
return true;
} catch (final IllegalArgumentException e) { } catch (final IllegalArgumentException e) {
sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!"); sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!");
} }