LunaChat v2.6.0 : Updated dependencies.
このコミットが含まれているのは:
1 親
592913440e
コミット
22cfbe56a6
14ファイル変更
+106
-93
検索条件に一致するファイルはありません
@@ -98,10 +98,10 @@ public class Channel implements ConfigurationSerializable {
|
||||
|
||||
/** BANされたプレイヤー */
|
||||
private List<String> banned;
|
||||
|
||||
|
||||
/** Muteされたプレイヤー */
|
||||
private List<String> muted;
|
||||
|
||||
|
||||
/** Hideしているプレイヤー */
|
||||
private List<String> hided;
|
||||
|
||||
@@ -145,7 +145,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
|
||||
/** 期限付きMuteの期限(key=プレイヤー名、value=期日(ミリ秒)) */
|
||||
private Map<String, Long> muteExpires;
|
||||
|
||||
|
||||
/** 1:1チャットの相手名 */
|
||||
private String privateMessageTo;
|
||||
|
||||
@@ -209,7 +209,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
public boolean isForceJoinChannel() {
|
||||
return LunaChat.config.getForceJoinChannels().contains(name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* このチャンネルのモデレータ権限を持っているかどうかを確認する
|
||||
* @param sender 権限を確認する対象
|
||||
@@ -232,9 +232,9 @@ public class Channel implements ConfigurationSerializable {
|
||||
player.sendMessage( PREERR + ERRMSG_MUTED );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String preReplaceMessage = message;
|
||||
|
||||
|
||||
// 一時的にJapanizeスキップ設定かどうかを確認する
|
||||
boolean skipJapanize = false;
|
||||
String marker = LunaChat.config.getNoneJapanizeMarker();
|
||||
@@ -272,7 +272,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
maskedMessage = event.getNgMaskedMessage();
|
||||
|
||||
// 2byteコードを含むか、半角カタカナのみなら、Japanize変換は行わない
|
||||
if ( !skipJapanize &&
|
||||
if ( !skipJapanize &&
|
||||
( message.getBytes().length > message.length() ||
|
||||
message.matches("[ \\uFF61-\\uFF9F]+") ) ) {
|
||||
skipJapanize = true;
|
||||
@@ -306,7 +306,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
// メッセージの送信
|
||||
sendMessage(player, maskedMessage, msgFormat, true);
|
||||
}
|
||||
|
||||
|
||||
// 非同期実行タスクがある場合、追加で実行する
|
||||
if ( delayedTask != null ) {
|
||||
Bukkit.getScheduler().runTask(LunaChat.instance, delayedTask);
|
||||
@@ -334,7 +334,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
String m = String.format(temp, name);
|
||||
player.sendMessage(m);
|
||||
}
|
||||
|
||||
|
||||
} else if ( LunaChat.config.getNgwordAction() == NGWordAction.MUTE ) {
|
||||
// Muteする
|
||||
|
||||
@@ -346,7 +346,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ほかの連携先などから、このチャットに発言する
|
||||
* @param player プレイヤー名
|
||||
@@ -354,10 +354,10 @@ public class Channel implements ConfigurationSerializable {
|
||||
* @param message メッセージ
|
||||
*/
|
||||
public void chatFromOtherSource(String player, String source, String message) {
|
||||
|
||||
|
||||
// 表示名
|
||||
String name = player + "@" + source;
|
||||
|
||||
|
||||
// NGワード発言のマスク
|
||||
String maskedMessage = message;
|
||||
for ( String word : LunaChat.config.getNgword() ) {
|
||||
@@ -437,7 +437,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 非表示設定プレイヤーだったら、リストから削除する
|
||||
if ( hided.contains(name) ) {
|
||||
hided.remove(name);
|
||||
@@ -481,7 +481,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
* @param format フォーマット
|
||||
* @param sendDynmap dynmapへ送信するかどうか
|
||||
*/
|
||||
protected void sendMessage(Player player, String message,
|
||||
protected void sendMessage(Player player, String message,
|
||||
String format, boolean sendDynmap) {
|
||||
|
||||
String originalMessage = new String(message);
|
||||
@@ -489,7 +489,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
// 受信者を設定する
|
||||
ArrayList<Player> recipients = new ArrayList<Player>();
|
||||
boolean isRangeChat = false;
|
||||
|
||||
|
||||
if ( isBroadcastChannel() ) {
|
||||
// ブロードキャストチャンネル
|
||||
|
||||
@@ -532,7 +532,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
// 通常チャンネル
|
||||
|
||||
for ( String name : members ) {
|
||||
Player p = Bukkit.getPlayerExact(name);
|
||||
Player p = Utility.getPlayerExact(name);
|
||||
if ( p != null && !hided.contains(p.getName()) ) {
|
||||
recipients.add(p);
|
||||
}
|
||||
@@ -543,7 +543,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
if ( format != null ) {
|
||||
message = format.replace("%msg", message);
|
||||
}
|
||||
|
||||
|
||||
// イベントコール
|
||||
LunaChatChannelMessageEvent event =
|
||||
new LunaChatChannelMessageEvent(
|
||||
@@ -556,7 +556,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
if ( LunaChat.config.isSendBroadcastChannelChatToDynmap() &&
|
||||
sendDynmap &&
|
||||
LunaChat.dynmap != null &&
|
||||
isBroadcastChannel() &&
|
||||
isBroadcastChannel() &&
|
||||
!isWorldRange ) {
|
||||
if ( LunaChat.config.isSendFormattedMessageToDynmap() ) {
|
||||
if ( player != null ) {
|
||||
@@ -572,16 +572,16 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 送信する
|
||||
for ( Player p : recipients ) {
|
||||
p.sendMessage(message);
|
||||
}
|
||||
|
||||
|
||||
// 受信者が自分以外いない場合は、メッセージを表示する
|
||||
if ( isRangeChat && (
|
||||
if ( isRangeChat && (
|
||||
recipients.size() == 0 ||
|
||||
(recipients.size() == 1 &&
|
||||
(recipients.size() == 1 &&
|
||||
recipients.get(0).getName().equals(player.getName()) ) ) ) {
|
||||
String msg = replaceKeywordsForSystemMessages(MSG_NO_RECIPIENT, "");
|
||||
player.sendMessage(msg);
|
||||
@@ -614,7 +614,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
// メンバーを、5人ごとに表示する
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append(INFO_PREFIX);
|
||||
|
||||
|
||||
for ( int i=0; i<members.size(); i++ ) {
|
||||
|
||||
if ( i%5 == 0 && i != 0 ) {
|
||||
@@ -641,12 +641,12 @@ public class Channel implements ConfigurationSerializable {
|
||||
|
||||
info.add(buf.toString());
|
||||
}
|
||||
|
||||
|
||||
// シークレットチャンネルかどうか
|
||||
if ( !visible ) {
|
||||
info.add(INFO_SECRET);
|
||||
}
|
||||
|
||||
|
||||
// パスワード設定があるかどうか
|
||||
if ( password.length() > 0 ) {
|
||||
if ( !forModerator ) {
|
||||
@@ -655,23 +655,23 @@ public class Channel implements ConfigurationSerializable {
|
||||
info.add(INFO_PASSWORD + " " + password);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 範囲チャット、ワールドチャット
|
||||
if ( isWorldRange && chatRange > 0 ) {
|
||||
info.add(String.format(INFO_RANGECHAT, chatRange));
|
||||
} else if ( isWorldRange ) {
|
||||
info.add(INFO_WORLDCHAT);
|
||||
}
|
||||
|
||||
|
||||
if ( forModerator ) {
|
||||
|
||||
|
||||
// フォーマット情報
|
||||
info.add(INFO_FORMAT + format);
|
||||
|
||||
|
||||
// Muteリスト情報、5人ごとに表示する
|
||||
if ( muted.size() > 0 ) {
|
||||
info.add(INFO_MUTED);
|
||||
|
||||
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append(INFO_PREFIX + ChatColor.WHITE);
|
||||
for ( int i=0; i<muted.size(); i++ ) {
|
||||
@@ -682,7 +682,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
buf.append(muted.get(i) + ",");
|
||||
}
|
||||
|
||||
|
||||
info.add(buf.toString());
|
||||
}
|
||||
|
||||
@@ -700,11 +700,11 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
buf.append(banned.get(i) + ",");
|
||||
}
|
||||
|
||||
|
||||
info.add(buf.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
info.add(LIST_ENDLINE);
|
||||
|
||||
return info;
|
||||
@@ -716,7 +716,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
* @return オンラインかどうか
|
||||
*/
|
||||
private boolean isOnlinePlayer(String playerName) {
|
||||
Player p = Bukkit.getPlayerExact(playerName);
|
||||
Player p = Utility.getPlayerExact(playerName);
|
||||
return ( p != null && p.isOnline() );
|
||||
}
|
||||
|
||||
@@ -820,29 +820,29 @@ public class Channel implements ConfigurationSerializable {
|
||||
|
||||
return members.size();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 期限付きBanや期限付きMuteをチェックし、期限が切れていたら解除を行う
|
||||
*/
|
||||
public void checkExpires() {
|
||||
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
|
||||
// 期限付きBANのチェック
|
||||
for ( String name : banExpires.keySet() ) {
|
||||
if ( banExpires.get(name) <= now ) {
|
||||
|
||||
|
||||
// 期限マップから削除し、BANを解除
|
||||
banExpires.remove(name);
|
||||
if ( banned.contains(name) ) {
|
||||
banned.remove(name);
|
||||
save();
|
||||
|
||||
|
||||
// メッセージ通知を流す
|
||||
String msg = String.format(MSG_BAN_EXPIRED, this.name, name);
|
||||
sendMessage(null, msg, null, false);
|
||||
|
||||
Player player = Bukkit.getPlayerExact(name);
|
||||
|
||||
Player player = Utility.getPlayerExact(name);
|
||||
if ( player != null ) {
|
||||
msg = PREINFO + String.format(MSG_BAN_EXPIRED_PLAYER, this.name);
|
||||
player.sendMessage(msg);
|
||||
@@ -850,22 +850,22 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 期限付きMuteのチェック
|
||||
for ( String name : muteExpires.keySet() ) {
|
||||
if ( muteExpires.get(name) <= now ) {
|
||||
|
||||
|
||||
// 期限マップから削除し、Muteを解除
|
||||
muteExpires.remove(name);
|
||||
if ( muted.contains(name) ) {
|
||||
muted.remove(name);
|
||||
save();
|
||||
|
||||
|
||||
// メッセージ通知を流す
|
||||
String msg = String.format(MSG_MUTE_EXPIRED, this.name, name);
|
||||
sendMessage(null, msg, null, false);
|
||||
|
||||
Player player = Bukkit.getPlayerExact(name);
|
||||
|
||||
Player player = Utility.getPlayerExact(name);
|
||||
if ( player != null ) {
|
||||
msg = PREINFO + String.format(MSG_MUTE_EXPIRED_PLAYER, this.name);
|
||||
player.sendMessage(msg);
|
||||
@@ -1052,7 +1052,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
* @return チャンネルのメンバー
|
||||
*/
|
||||
public List<String> getMembers() {
|
||||
|
||||
|
||||
// ブロードキャストチャンネルなら、
|
||||
// 現在サーバーに接続している全プレイヤーをメンバーとして返す
|
||||
if ( isBroadcastChannel() ) {
|
||||
@@ -1063,7 +1063,7 @@ public class Channel implements ConfigurationSerializable {
|
||||
}
|
||||
return mem;
|
||||
}
|
||||
|
||||
|
||||
return members;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ public class ChannelManager implements LunaChatAPI {
|
||||
}
|
||||
return japanize.get(playerName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* デフォルトチャンネル設定を全て削除する
|
||||
*/
|
||||
@@ -445,7 +445,7 @@ public class ChannelManager implements LunaChatAPI {
|
||||
// チャンネルのメンバーを強制解散させる
|
||||
String message = String.format(MSG_BREAKUP, channelName);
|
||||
for ( String pname : channel.getMembers() ) {
|
||||
Player player = Bukkit.getPlayerExact(pname);
|
||||
Player player = Utility.getPlayerExact(pname);
|
||||
if ( player != null ) {
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
// 強制参加チャンネル設定を確認し、参加させる
|
||||
forceJoinToForceJoinChannels(player);
|
||||
|
||||
|
||||
// グローバルチャンネル設定がある場合
|
||||
if ( !LunaChat.config.getGlobalChannel().equals("") ) {
|
||||
tryJoinToGlobalChannel(player);
|
||||
@@ -114,7 +114,7 @@ public class PlayerListener implements Listener {
|
||||
boolean isAllOffline = true;
|
||||
for ( String pname : channel.getMembers() ) {
|
||||
if ( !pname.equals(player.getName()) ) {
|
||||
Player p = Bukkit.getPlayerExact(pname);
|
||||
Player p = Utility.getPlayerExact(pname);
|
||||
if ( p != null && p.isOnline() ) {
|
||||
isAllOffline = false;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
// カラーコード置き換え
|
||||
message = Utility.replaceColorCode(message);
|
||||
|
||||
|
||||
// 一時的にJapanizeスキップ設定かどうかを確認する
|
||||
boolean skipJapanize = false;
|
||||
String marker = LunaChat.config.getNoneJapanizeMarker();
|
||||
@@ -193,7 +193,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
// 2byteコードを含むなら、Japanize変換は行わない
|
||||
if ( !skipJapanize &&
|
||||
if ( !skipJapanize &&
|
||||
( message.getBytes().length > message.length() ||
|
||||
message.matches("[ \\uFF61-\\uFF9F]+") ) ) {
|
||||
skipJapanize = true;
|
||||
@@ -224,7 +224,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
DelayedJapanizeConvertTask task = new DelayedJapanizeConvertTask(message,
|
||||
LunaChat.config.getJapanizeType(), null, player, taskFormat, null);
|
||||
|
||||
|
||||
// 発言処理を必ず先に実施させるため、遅延を入れてタスクを実行する。
|
||||
int wait = LunaChat.config.getJapanizeWait();
|
||||
Bukkit.getScheduler().runTaskLater(LunaChat.instance, task, wait);
|
||||
@@ -260,29 +260,29 @@ public class PlayerListener implements Listener {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 強制参加チャンネルへ参加させる
|
||||
* @param player プレイヤー
|
||||
*/
|
||||
private void forceJoinToForceJoinChannels(Player player) {
|
||||
|
||||
|
||||
List<String> forceJoinChannels = LunaChat.config.getForceJoinChannels();
|
||||
String playerName = player.getName();
|
||||
|
||||
|
||||
for ( String cname : forceJoinChannels ) {
|
||||
|
||||
|
||||
// チャンネルが存在しない場合は作成する
|
||||
Channel channel = LunaChat.manager.getChannel(cname);
|
||||
if ( channel == null ) {
|
||||
channel = LunaChat.manager.createChannel(cname);
|
||||
}
|
||||
|
||||
|
||||
// チャンネルのメンバーでないなら、参加する
|
||||
if ( !channel.getMembers().contains(playerName) ) {
|
||||
channel.addMember(playerName);
|
||||
}
|
||||
|
||||
|
||||
// デフォルト発言先が無いなら、グローバルチャンネルに設定する
|
||||
Channel dchannel = LunaChat.manager.getDefaultChannel(playerName);
|
||||
if ( dchannel == null ) {
|
||||
|
||||
@@ -17,7 +17,9 @@ import java.io.OutputStreamWriter;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* ユーティリティクラス
|
||||
@@ -181,4 +183,14 @@ public class Utility {
|
||||
}
|
||||
return code.matches("&[0-9a-f]");
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定された名前のプレイヤーを返す
|
||||
* @param name プレイヤー名
|
||||
* @return プレイヤー、該当プレイヤーがオンラインでない場合はnullになる。
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static Player getPlayerExact(String name) {
|
||||
return Bukkit.getPlayerExact(name);
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* banコマンドの実行クラス
|
||||
@@ -21,7 +21,7 @@ public class BanCommand extends SubCommandAbst {
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY1 = "usageBan";
|
||||
private static final String USAGE_KEY2 = "usageBan2";
|
||||
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -139,7 +139,7 @@ public class BanCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// BAN実行
|
||||
Player kicked = Bukkit.getPlayerExact(kickedName);
|
||||
Player kicked = Utility.getPlayerExact(kickedName);
|
||||
channel.getBanned().add(kickedName);
|
||||
if ( expireMinutes != -1 ) {
|
||||
long expire = System.currentTimeMillis() + expireMinutes * 60 * 1000;
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* denyコマンドの実行クラス
|
||||
* @author ucchy
|
||||
@@ -92,7 +93,7 @@ public class DenyCommand extends SubCommandAbst {
|
||||
|
||||
// メッセージ送信
|
||||
sendResourceMessage(sender, PREINFO, "cmdmsgDeny");
|
||||
Player inviter = Bukkit.getPlayerExact(inviterName);
|
||||
Player inviter = Utility.getPlayerExact(inviterName);
|
||||
if (inviter != null) {
|
||||
sendResourceMessage(inviter, PREINFO, "cmdmsgDenyed");
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* inviteコマンドの実行クラス
|
||||
@@ -104,7 +104,7 @@ public class InviteCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// 招待相手が存在するかどうかを確認する
|
||||
Player invited = Bukkit.getPlayerExact(invitedName);
|
||||
Player invited = Utility.getPlayerExact(invitedName);
|
||||
if (invited == null) {
|
||||
sendResourceMessage(sender, PREERR,
|
||||
"errmsgNotfoundPlayer", invitedName);
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* kickコマンドの実行クラス
|
||||
@@ -20,7 +20,7 @@ public class KickCommand extends SubCommandAbst {
|
||||
private static final String COMMAND_NAME = "kick";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageKick";
|
||||
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -122,7 +122,7 @@ public class KickCommand extends SubCommandAbst {
|
||||
sendResourceMessage(sender, PREINFO,
|
||||
"cmdmsgKick", kickedName, channel.getName());
|
||||
|
||||
Player kicked = Bukkit.getPlayerExact(kickedName);
|
||||
Player kicked = Utility.getPlayerExact(kickedName);
|
||||
if (kicked != null) {
|
||||
sendResourceMessage(kicked, PREINFO,
|
||||
"cmdmsgKicked", channel.getName());
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -14,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
import com.github.ucchyocean.lc.LunaChat;
|
||||
import com.github.ucchyocean.lc.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc.Resources;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* Japanize変換設定コマンド
|
||||
@@ -22,7 +22,7 @@ import com.github.ucchyocean.lc.Resources;
|
||||
public class LunaChatJapanizeCommand implements CommandExecutor {
|
||||
|
||||
private static final String PERM_JAPANIZE_OTHER = "lunachat-admin.japanize-other";
|
||||
|
||||
|
||||
private static final String PREINFO = Resources.get("infoPrefix");
|
||||
private static final String PREERR = Resources.get("errorPrefix");
|
||||
|
||||
@@ -65,7 +65,7 @@ public class LunaChatJapanizeCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
// 指定されたプレイヤーが存在するかチェック
|
||||
Player target = Bukkit.getPlayerExact(args[0]);
|
||||
Player target = Utility.getPlayerExact(args[0]);
|
||||
if ( target == null ) {
|
||||
sendResourceMessage(sender, PREERR,
|
||||
"errmsgNotfoundPlayer", args[0]);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -15,6 +14,7 @@ import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.LunaChat;
|
||||
import com.github.ucchyocean.lc.LunaChatAPI;
|
||||
import com.github.ucchyocean.lc.Resources;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* 1:1チャット送信コマンド
|
||||
@@ -74,7 +74,7 @@ public class LunaChatMessageCommand implements CommandExecutor {
|
||||
protected void sendTellMessage(Player inviter, String invitedName, String message) {
|
||||
|
||||
// 招待相手が存在するかどうかを確認する
|
||||
Player invited = Bukkit.getPlayerExact(invitedName);
|
||||
Player invited = Utility.getPlayerExact(invitedName);
|
||||
if (invited == null) {
|
||||
sendResourceMessage(inviter, PREERR,
|
||||
"errmsgNotfoundPlayer", invitedName);
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* muteコマンドの実行クラス
|
||||
@@ -21,7 +21,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY1 = "usageMute";
|
||||
private static final String USAGE_KEY2 = "usageMute2";
|
||||
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -133,7 +133,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// Mute実行
|
||||
Player kicked = Bukkit.getPlayerExact(kickedName);
|
||||
Player kicked = Utility.getPlayerExact(kickedName);
|
||||
channel.getMuted().add(kickedName);
|
||||
if ( expireMinutes != -1 ) {
|
||||
long expire = System.currentTimeMillis() + expireMinutes * 60 * 1000;
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* pardonコマンドの実行クラス
|
||||
@@ -20,7 +20,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
private static final String COMMAND_NAME = "pardon";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usagePardon";
|
||||
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -111,7 +111,7 @@ public class PardonCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// BAN解除実行
|
||||
Player kicked = Bukkit.getPlayerExact(kickedName);
|
||||
Player kicked = Utility.getPlayerExact(kickedName);
|
||||
channel.getBanned().remove(kickedName);
|
||||
channel.save();
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc.command;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.github.ucchyocean.lc.Channel;
|
||||
import com.github.ucchyocean.lc.Utility;
|
||||
|
||||
/**
|
||||
* unmuteコマンドの実行クラス
|
||||
@@ -20,7 +20,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
private static final String COMMAND_NAME = "unmute";
|
||||
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
|
||||
private static final String USAGE_KEY = "usageUnmute";
|
||||
|
||||
|
||||
/**
|
||||
* コマンドを取得します。
|
||||
* @return コマンド
|
||||
@@ -111,7 +111,7 @@ public class UnmuteCommand extends SubCommandAbst {
|
||||
}
|
||||
|
||||
// Mute解除実行
|
||||
Player kicked = Bukkit.getPlayerExact(kickedName);
|
||||
Player kicked = Utility.getPlayerExact(kickedName);
|
||||
channel.getMuted().remove(kickedName);
|
||||
channel.save();
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする