LunaChat v2.6.11 : Fixed issue #111. (WIP)
このコミットが含まれているのは:
1 親
4733ae7e88
コミット
b9fbc2faf1
7ファイル変更
+261
-36
検索条件に一致するファイルはありません
@@ -8,6 +8,7 @@ package com.github.ucchyocean.lc.command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
import com.github.ucchyocean.lc.channel.Channel;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
|
||||
@@ -96,24 +97,47 @@ public class UnhideCommand extends SubCommandAbst {
|
||||
return true;
|
||||
}
|
||||
|
||||
// チャンネルが存在するかどうかをチェックする
|
||||
if ( !api.isExistChannel(cname) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExist");
|
||||
// チャンネルかプレイヤーが存在するかどうかをチェックする
|
||||
boolean isChannelCommand = false;
|
||||
if ( api.isExistChannel(cname) ) {
|
||||
isChannelCommand = true;
|
||||
} else if ( Utility.getOfflinePlayer(cname) == null ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNotExistChannelAndPlayer");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 非表示になっているかどうかをチェックする
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( !channel.getHided().contains(player) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyUnhided");
|
||||
if ( isChannelCommand ) {
|
||||
// チャンネルが対象の場合の処理
|
||||
|
||||
// 非表示になっているかどうかをチェックする
|
||||
Channel channel = api.getChannel(cname);
|
||||
if ( !channel.getHided().contains(player) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyUnhided");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 設定する
|
||||
channel.getHided().remove(player);
|
||||
channel.save();
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgUnhided", channel.getName());
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
// プレイヤーが対象の場合の処理
|
||||
|
||||
// 既に表示になっていないかどうかをチェックする
|
||||
ChannelPlayer hided = ChannelPlayer.getChannelPlayer(cname);
|
||||
if ( !api.getHidelist(hided).contains(player.toString()) ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgAlreadyUnhidedPlayer");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 設定する
|
||||
api.removeHidelist(player, hided);
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgUnhidedPlayer", hided.getDisplayName());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// 設定する
|
||||
channel.getHided().remove(player);
|
||||
channel.save();
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgUnhided", channel.getName());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする