diff --git a/src/main/java/com/github/ucchyocean/lc/Channel.java b/src/main/java/com/github/ucchyocean/lc/Channel.java index f973a51..552e032 100644 --- a/src/main/java/com/github/ucchyocean/lc/Channel.java +++ b/src/main/java/com/github/ucchyocean/lc/Channel.java @@ -455,9 +455,8 @@ public class Channel implements ConfigurationSerializable { p.sendMessage(message); } // 受信者が自分以外いない場合は、メッセージを表示する - if ( recipients.size() == 0 || - (recipients.size() == 1 && - recipients.get(0).getName().equals(player.getName()) ) ) { + if ( isWorldRange && ( recipients.size() == 0 || + (recipients.size() == 1 && recipients.get(0).getName().equals(player.getName()) ) ) ) { String msg = replaceKeywords(MSG_NO_RECIPIENT, null); player.sendMessage(msg); } diff --git a/src/main/java/com/github/ucchyocean/lc/ChannelManager.java b/src/main/java/com/github/ucchyocean/lc/ChannelManager.java index 688b03c..48ab848 100644 --- a/src/main/java/com/github/ucchyocean/lc/ChannelManager.java +++ b/src/main/java/com/github/ucchyocean/lc/ChannelManager.java @@ -355,6 +355,7 @@ public class ChannelManager implements LunaChatAPI { */ @Override public Channel getChannel(String channelName) { + if ( channelName == null ) return null; return channels.get(channelName.toLowerCase()); } diff --git a/src/main/java/com/github/ucchyocean/lc/LunaChat.java b/src/main/java/com/github/ucchyocean/lc/LunaChat.java index 932009c..ac277f8 100644 --- a/src/main/java/com/github/ucchyocean/lc/LunaChat.java +++ b/src/main/java/com/github/ucchyocean/lc/LunaChat.java @@ -14,6 +14,7 @@ import org.bukkit.plugin.java.JavaPlugin; import com.github.ucchyocean.lc.bridge.DynmapBridge; import com.github.ucchyocean.lc.bridge.VaultChatBridge; import com.github.ucchyocean.lc.command.LunaChatCommand; +import com.github.ucchyocean.lc.command.LunaChatJapanizeCommand; import com.github.ucchyocean.lc.command.LunaChatMessageCommand; import com.github.ucchyocean.lc.command.LunaChatReplyCommand; @@ -61,6 +62,7 @@ public class LunaChat extends JavaPlugin { getCommand("lunachat").setExecutor(new LunaChatCommand()); getCommand("message").setExecutor(new LunaChatMessageCommand()); getCommand("reply").setExecutor(new LunaChatReplyCommand()); + getCommand("lcjapanize").setExecutor(new LunaChatJapanizeCommand()); // シリアル化可能オブジェクトの登録 ConfigurationSerialization.registerClass(Channel.class, "Channel"); diff --git a/src/main/java/com/github/ucchyocean/lc/command/LunaChatCommand.java b/src/main/java/com/github/ucchyocean/lc/command/LunaChatCommand.java index a0a8cc6..9d4daf1 100644 --- a/src/main/java/com/github/ucchyocean/lc/command/LunaChatCommand.java +++ b/src/main/java/com/github/ucchyocean/lc/command/LunaChatCommand.java @@ -40,6 +40,7 @@ public class LunaChatCommand implements CommandExecutor { commands.add(new KickCommand()); commands.add(new BanCommand()); commands.add(new PardonCommand()); + commands.add(new InfoCommand()); commands.add(new CreateCommand()); commands.add(new RemoveCommand()); commands.add(new FormatCommand()); diff --git a/src/main/java/com/github/ucchyocean/lc/command/LunaChatJapanizeCommand.java b/src/main/java/com/github/ucchyocean/lc/command/LunaChatJapanizeCommand.java index 65824c9..2c109b5 100644 --- a/src/main/java/com/github/ucchyocean/lc/command/LunaChatJapanizeCommand.java +++ b/src/main/java/com/github/ucchyocean/lc/command/LunaChatJapanizeCommand.java @@ -22,6 +22,8 @@ import com.github.ucchyocean.lc.Resources; public class LunaChatJapanizeCommand implements CommandExecutor { private static final String PERM_JAPANIZE_OTHER = "lunachat.japanize-other"; + + private static final String PREINFO = Resources.get("infoPrefix"); private static final String PREERR = Resources.get("errorPrefix"); /** @@ -47,6 +49,8 @@ public class LunaChatJapanizeCommand implements CommandExecutor { LunaChatAPI api = LunaChat.instance.getLunaChatAPI(); api.setPlayersJapanize(player.getName(), value); + sendResourceMessage(sender, PREINFO, + "cmdmsgPlayerJapanize", args[0]); return true; } else if ( args.length == 2 && @@ -69,10 +73,14 @@ public class LunaChatJapanizeCommand implements CommandExecutor { } // Japanize設定をon/offにする - boolean value = args[0].equalsIgnoreCase("on"); + boolean value = args[1].equalsIgnoreCase("on"); LunaChatAPI api = LunaChat.instance.getLunaChatAPI(); api.setPlayersJapanize(target.getName(), value); + sendResourceMessage(target, PREINFO, + "cmdmsgPlayerJapanize", args[1]); + sendResourceMessage(sender, PREINFO, + "cmdmsgPlayerJapanizeOther", args[0], args[1]); return true; } diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index 57e6a01..d47b36e 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -44,6 +44,9 @@ cmdmsgOption: '%s を %s に設定しました。' cmdmsgTemplate: 'テンプレート %s番を、%s に設定しました。' cmdmsgTemplateRemove: 'テンプレート %s番を削除しました。' +cmdmsgPlayerJapanize: 'Your chat''s Japanize conversion was turned %s.' +cmdmsgPlayerJapanizeOther: '%s さんのJapanize変換を %s にしました。' + errmsgIngame: 'このコマンドはゲーム内からしか実行できません。' errmsgCommand: 'コマンドの指定が正しくありません。' errmsgNotExist: '指定されたチャンネルが存在しません。'