diff --git a/pom.xml b/pom.xml
index bafc6f5..029469b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
pw.yumc
RocketJump
- 1.3.1
+ 1.3.2
RocketJump
火箭跳跃 特效Duang...
@@ -65,8 +65,7 @@
-
+
${java.home}/lib/rt.jar
@@ -76,7 +75,7 @@
- &c修复命令部分代码...
+ &c修复命令失效的问题...
DEBUG
UTF-8
diff --git a/src/main/java/pw/yumc/RocketJump/RocketJumpCommands.java b/src/main/java/pw/yumc/RocketJump/RocketJumpCommands.java
index 9fc0e12..c1af9f2 100644
--- a/src/main/java/pw/yumc/RocketJump/RocketJumpCommands.java
+++ b/src/main/java/pw/yumc/RocketJump/RocketJumpCommands.java
@@ -1,12 +1,11 @@
package pw.yumc.RocketJump;
import org.bukkit.GameMode;
-import org.bukkit.command.Command;
-import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.commands.HandlerCommand;
import cn.citycraft.PluginHelper.commands.HandlerCommands;
+import cn.citycraft.PluginHelper.commands.InvokeCommandEvent;
/**
*
@@ -14,21 +13,21 @@ import cn.citycraft.PluginHelper.commands.HandlerCommands;
* @author 喵♂呜
*/
public class RocketJumpCommands implements HandlerCommands {
- @HandlerCommand(name = "off", description = "§a开启火箭跳跃")
- public void off(final CommandSender sender, final Command cmd, final String string, final String[] args) {
- final Player p = (Player) sender;
+ @HandlerCommand(name = "off", description = "§a开启火箭跳跃", onlyPlayerExecutable = true)
+ public void off(final InvokeCommandEvent e) {
+ final Player p = (Player) e.getSender();
RocketJump.Dante.remove(p.getName());
- sender.sendMessage("§6[RocketJump]§4已关闭...");
+ e.getSender().sendMessage("§6[RocketJump]§4已关闭...");
if (p.getGameMode() == GameMode.SURVIVAL) {
p.setAllowFlight(false);
}
}
- @HandlerCommand(name = "on", description = "§c关闭火箭跳跃")
- public void on(final CommandSender sender, final Command cmd, final String string, final String[] args) {
- final Player p = (Player) sender;
+ @HandlerCommand(name = "on", description = "§c关闭火箭跳跃", onlyPlayerExecutable = true)
+ public void on(final InvokeCommandEvent e) {
+ final Player p = (Player) e.getSender();
RocketJump.Dante.add(p.getName());
- sender.sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
+ e.getSender().sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
p.setAllowFlight(true);
}
}