mirror of
https://e.coding.net/circlecloud/TeleportRandom.git
synced 2024-12-25 16:28:49 +00:00
fix: 修复控制台命令失效问题
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
85e530a127
commit
13ccb1a96b
@ -27,6 +27,18 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(final CommandSender sender, final Command cmd, final String string, final String[] args) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
config.reload();
|
||||
sender.sendMessage(getPrefix() + config.getMessage("Message.Reload"));
|
||||
return true;
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
sender.sendMessage("玩家: /tpr [范围] [世界]");
|
||||
sender.sendMessage("控制台: /tpr <玩家> [范围] [世界]");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (sender instanceof Player) {
|
||||
final Player p = (Player) sender;
|
||||
@ -59,18 +71,6 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
} catch (final IllegalArgumentException e) {
|
||||
if (args.length > 0) {
|
||||
if (args[0].equalsIgnoreCase("reload")) {
|
||||
config.reload();
|
||||
sender.sendMessage(getPrefix() + config.getMessage("Message.Reload"));
|
||||
return true;
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("help")) {
|
||||
sender.sendMessage("玩家: /tpr [范围] [世界]");
|
||||
sender.sendMessage("控制台: /tpr <玩家> [范围] [世界]");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!");
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user