1
0
mirror of https://e.coding.net/circlecloud/RocketJump.git synced 2024-11-22 14:58:50 +00:00

fix: 修复命令注解错误的问题

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-06-05 18:10:05 +08:00
parent 3e67c29eae
commit 65e79bd6de
2 changed files with 12 additions and 14 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId> <groupId>pw.yumc</groupId>
<artifactId>RocketJump</artifactId> <artifactId>RocketJump</artifactId>
<version>1.3.1</version> <version>1.3.2</version>
<name>RocketJump</name> <name>RocketJump</name>
<description>火箭跳跃 特效Duang...</description> <description>火箭跳跃 特效Duang...</description>
<build> <build>
@ -65,8 +65,7 @@
<configuration> <configuration>
<options> <options>
<option>-repackageclasses ${project.groupId}.${project.artifactId}</option> <option>-repackageclasses ${project.groupId}.${project.artifactId}</option>
<option>-keep class <option>-keep class ${project.groupId}.${project.artifactId}.${project.artifactId}</option>
${project.groupId}.${project.artifactId}.${project.artifactId}</option>
</options> </options>
<libs> <libs>
<lib>${java.home}/lib/rt.jar</lib> <lib>${java.home}/lib/rt.jar</lib>
@ -76,7 +75,7 @@
</plugins> </plugins>
</build> </build>
<properties> <properties>
<update.description>&amp;c修复命令部分代码...</update.description> <update.description>&amp;c修复命令失效的问题...</update.description>
<update.changes></update.changes> <update.changes></update.changes>
<env.GIT_COMMIT>DEBUG</env.GIT_COMMIT> <env.GIT_COMMIT>DEBUG</env.GIT_COMMIT>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@ -1,12 +1,11 @@
package pw.yumc.RocketJump; package pw.yumc.RocketJump;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.commands.HandlerCommand; import cn.citycraft.PluginHelper.commands.HandlerCommand;
import cn.citycraft.PluginHelper.commands.HandlerCommands; import cn.citycraft.PluginHelper.commands.HandlerCommands;
import cn.citycraft.PluginHelper.commands.InvokeCommandEvent;
/** /**
* *
@ -14,21 +13,21 @@ import cn.citycraft.PluginHelper.commands.HandlerCommands;
* @author * @author
*/ */
public class RocketJumpCommands implements HandlerCommands { public class RocketJumpCommands implements HandlerCommands {
@HandlerCommand(name = "off", description = "§a开启火箭跳跃") @HandlerCommand(name = "off", description = "§a开启火箭跳跃", onlyPlayerExecutable = true)
public void off(final CommandSender sender, final Command cmd, final String string, final String[] args) { public void off(final InvokeCommandEvent e) {
final Player p = (Player) sender; final Player p = (Player) e.getSender();
RocketJump.Dante.remove(p.getName()); RocketJump.Dante.remove(p.getName());
sender.sendMessage("§6[RocketJump]§4已关闭..."); e.getSender().sendMessage("§6[RocketJump]§4已关闭...");
if (p.getGameMode() == GameMode.SURVIVAL) { if (p.getGameMode() == GameMode.SURVIVAL) {
p.setAllowFlight(false); p.setAllowFlight(false);
} }
} }
@HandlerCommand(name = "on", description = "§c关闭火箭跳跃") @HandlerCommand(name = "on", description = "§c关闭火箭跳跃", onlyPlayerExecutable = true)
public void on(final CommandSender sender, final Command cmd, final String string, final String[] args) { public void on(final InvokeCommandEvent e) {
final Player p = (Player) sender; final Player p = (Player) e.getSender();
RocketJump.Dante.add(p.getName()); RocketJump.Dante.add(p.getName());
sender.sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。"); e.getSender().sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
p.setAllowFlight(true); p.setAllowFlight(true);
} }
} }