From 65e79bd6deb2ab019e591b544a065059d3df8dba Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 5 Jun 2016 18:10:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 7 +++---- .../yumc/RocketJump/RocketJumpCommands.java | 19 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) 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); } }