LunaChat v2.5.3 : Changed version number.
このコミットが含まれているのは:
1 親
33b2195065
コミット
11e7c0c681
50ファイル変更
+5003
-4990
検索条件に一致するファイルはありません
@@ -1,118 +1,118 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2013
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
|
||||
/**
|
||||
* unhideコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class UnhideCommand extends SubCommandAbst {
|
||||
|
||||
private static final String COMMAND_NAME = "unhide";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageUnhide";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return COMMAND_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return PERMISSION_NODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
return CommandType.USER;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
CommandSender sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
CommandSender sender, String label, String[] args) {
|
||||
|
||||
// プレイヤーでなければ終了する
|
||||
if (!(sender instanceof Player)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgIngame");
|
||||
return true;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
|
||||
// 引数チェック
|
||||
String cname = null;
|
||||
if ( args.length <= 1 ) {
|
||||
Channel def = api.getDefaultChannel(player.getName());
|
||||
if ( def != null ) {
|
||||
cname = def.getName();
|
||||
}
|
||||
} else if ( args.length >= 2 ) {
|
||||
cname = args[1];
|
||||
} else {
|
||||
sendResourceMessage(sender, PREERR, "errmsgCommand");
|
||||
return true;
|
||||
}
|
||||
|
||||
// チャンネルが存在するかどうかをチェックする
|
||||
if ( !api.isExistChannel(cname) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExist");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 非表示になっているかどうかをチェックする
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( !channel.getHided().contains(player.getName()) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyUnhided");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 設定する
|
||||
channel.getHided().remove(player.getName());
|
||||
channel.save();
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgUnhided", channel.getName());
|
||||
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license LGPLv3
|
||||
* @copyright Copyright ucchy 2013
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
|
||||
/**
|
||||
* unhideコマンドの実行クラス
|
||||
* @author ucchy
|
||||
*/
|
||||
public class UnhideCommand extends SubCommandAbst {
|
||||
|
||||
private static final String COMMAND_NAME = "unhide";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageUnhide";
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandName()
|
||||
*/
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return COMMAND_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* パーミッションノードを取得します。
|
||||
* @return パーミッションノード
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getPermissionNode()
|
||||
*/
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return PERMISSION_NODE;
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドの種別を取得します。
|
||||
* @return コマンド種別
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
|
||||
*/
|
||||
@Override
|
||||
public CommandType getCommandType() {
|
||||
return CommandType.USER;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用方法に関するメッセージをsenderに送信します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#sendUsageMessage()
|
||||
*/
|
||||
@Override
|
||||
public void sendUsageMessage(
|
||||
CommandSender sender, String label) {
|
||||
sendResourceMessage(sender, "", USAGE_KEY, label);
|
||||
}
|
||||
|
||||
/**
|
||||
* コマンドを実行します。
|
||||
* @param sender コマンド実行者
|
||||
* @param label 実行ラベル
|
||||
* @param args 実行時の引数
|
||||
* @return コマンドが実行されたかどうか
|
||||
* @see com.github.ucchyocean.lc.command.SubCommandAbst#runCommand(java.lang.String[])
|
||||
*/
|
||||
@Override
|
||||
public boolean runCommand(
|
||||
CommandSender sender, String label, String[] args) {
|
||||
|
||||
// プレイヤーでなければ終了する
|
||||
if (!(sender instanceof Player)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgIngame");
|
||||
return true;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
|
||||
// 引数チェック
|
||||
String cname = null;
|
||||
if ( args.length <= 1 ) {
|
||||
Channel def = api.getDefaultChannel(player.getName());
|
||||
if ( def != null ) {
|
||||
cname = def.getName();
|
||||
}
|
||||
} else if ( args.length >= 2 ) {
|
||||
cname = args[1];
|
||||
} else {
|
||||
sendResourceMessage(sender, PREERR, "errmsgCommand");
|
||||
return true;
|
||||
}
|
||||
|
||||
// チャンネルが存在するかどうかをチェックする
|
||||
if ( !api.isExistChannel(cname) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExist");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 非表示になっているかどうかをチェックする
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( !channel.getHided().contains(player.getName()) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyUnhided");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 設定する
|
||||
channel.getHided().remove(player.getName());
|
||||
channel.save();
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgUnhided", channel.getName());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする