35 lines
1.3 KiB
Java
35 lines
1.3 KiB
Java
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;
|
|
|
|
/**
|
|
*
|
|
* @since 2016年2月23日 上午11:20:51
|
|
* @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;
|
|
RocketJump.Dante.remove(p.getName());
|
|
sender.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;
|
|
RocketJump.Dante.add(p.getName());
|
|
sender.sendMessage("§6[RocketJump]§a火箭跳跃已开启,双击空格启动。。。");
|
|
p.setAllowFlight(true);
|
|
}
|
|
}
|