mirror of
https://e.coding.net/circlecloud/TeleportRandom.git
synced 2024-12-25 16:28:49 +00:00
feat: 修复数组越界错误
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
8fee67e861
commit
dc133a01f0
3
pom.xml
3
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>TeleportRandom</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.4.1</version>
|
||||
<name>TeleportRandom</name>
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
@ -59,6 +59,7 @@
|
||||
<properties>
|
||||
<update.description>&a代码重构版本</update.description>
|
||||
<update.changes>
|
||||
&b1.4.1 - &c修复AIOOBE错误...;
|
||||
&b1.4 - &a添加命令CD...;
|
||||
&b1.3.2 - &c修复上个版本的空指针错误...;
|
||||
&b1.3.1 - &c修复上个版本一个逻辑错误...;
|
||||
|
@ -26,16 +26,6 @@ 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[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;
|
||||
@ -54,7 +44,6 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
|
||||
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]);
|
||||
@ -73,6 +62,18 @@ public class TeleportRandom extends JavaPlugin implements CommandExecutor {
|
||||
} catch (final IllegalArgumentException e) {
|
||||
sender.sendMessage(getPrefix() + "§c非法的参数或不存在的世界!");
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user