コミットを比較

..
9 コミット
42個のファイルの変更、752行の追加、102行の削除

検索条件に一致するファイルはありません

+8 -3
ファイルの表示
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ucchyocean</groupId>
<artifactId>LunaChat</artifactId>
<version>2.5.0</version>
<version>2.5.2</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -52,7 +52,12 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.6.2-R1.0</version>
<version>1.6.4-R2.0</version>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.6.4-R2.0</version>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
@@ -62,7 +67,7 @@
<dependency>
<groupId>org.dynmap</groupId>
<artifactId>dynmap-api</artifactId>
<version>1.8</version>
<version>1.9</version>
</dependency>
</dependencies>
</project>
+47 -5
ファイルの表示
@@ -23,6 +23,7 @@ import org.bukkit.entity.Player;
import com.github.ucchyocean.lc.event.LunaChatChannelChatEvent;
import com.github.ucchyocean.lc.event.LunaChatChannelMemberChangedEvent;
import com.github.ucchyocean.lc.event.LunaChatChannelMessageEvent;
import com.github.ucchyocean.lc.japanize.JapanizeType;
/**
@@ -316,6 +317,39 @@ public class Channel implements ConfigurationSerializable {
}
}
}
/**
* ほかの連携先などから、このチャットに発言する
* @param player プレイヤー名
* @param source 連携元を判別する文字列
* @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() ) {
if ( maskedMessage.contains(word) ) {
maskedMessage = maskedMessage.replace(
word, Utility.getAstariskString(word.length()));
}
}
// キーワード置き換え
String msgFormat = replaceKeywords(format, null);
msgFormat = msgFormat.replace("%username", name);
msgFormat = msgFormat.replace("%prefix", "");
msgFormat = msgFormat.replace("%suffix", "");
// カラーコード置き換え
maskedMessage = Utility.replaceColorCode(maskedMessage);
// メッセージの送信
sendMessage(null, maskedMessage, msgFormat);
}
/**
* メンバーを追加する
@@ -473,6 +507,19 @@ public class Channel implements ConfigurationSerializable {
}
}
// フォーマットがある場合は置き換える
if ( format != null ) {
message = format.replace("%msg", message);
}
// イベントコール
LunaChatChannelMessageEvent event =
new LunaChatChannelMessageEvent(
name, player, message, recipients);
Bukkit.getPluginManager().callEvent(event);
message = event.getMessage();
recipients = event.getRecipients();
// 通常ブロードキャストなら、設定に応じてdynmapへ送信する
if ( LunaChat.config.isSendBroadcastChannelChatToDynmap() &&
LunaChat.dynmap != null &&
@@ -482,11 +529,6 @@ public class Channel implements ConfigurationSerializable {
else
LunaChat.dynmap.broadcast(message);
}
// フォーマットがある場合は置き換える
if ( format != null ) {
message = format.replace("%msg", message);
}
// 送信する
for ( Player p : recipients ) {
+3
ファイルの表示
@@ -53,6 +53,9 @@ public class LunaChat extends JavaPlugin {
temp = getServer().getPluginManager().getPlugin("dynmap");
if ( temp != null ) {
dynmap = DynmapBridge.load(temp);
if ( dynmap != null ) {
getServer().getPluginManager().registerEvents(dynmap, this);
}
}
// リスナーの登録
+38 -3
ファイルの表示
@@ -19,6 +19,9 @@ import com.github.ucchyocean.lc.japanize.JapanizeType;
*/
public class LunaChatConfig {
/** チャンネルチャット機能を利用可能にするかどうか */
private boolean enableChannelChat;
/** チャンネルチャットに入っていない人の発言を、グローバルとして扱うかどうか */
private boolean noJoinAsGlobal;
@@ -51,6 +54,9 @@ public class LunaChatConfig {
/** ブロードキャストチャンネルの発言内容を、dynmapに送信するかどうか。<br/>
* dynmapがロードされていない場合は、この設定は無視される(false扱い)。 */
private boolean sendBroadcastChannelChatToDynmap;
/** dynmapのWebUIから発言された発言内容を表示するチャンネル。 */
private String dynmapChannel;
/** NGワードの設定 */
private List<String> ngword;
@@ -108,6 +114,7 @@ public class LunaChatConfig {
LunaChat.instance.reloadConfig();
FileConfiguration config = LunaChat.instance.getConfig();
enableChannelChat = config.getBoolean("enableChannelChat", true);
noJoinAsGlobal = config.getBoolean("noJoinAsGlobal", true);
loggingChat = config.getBoolean("loggingChat", true);
displayChatOnConsole = config.getBoolean("displayChatOnConsole", false);
@@ -116,13 +123,25 @@ public class LunaChatConfig {
showListOnJoin = config.getBoolean("showListOnJoin", false);
createChannelOnJoinCommand =
config.getBoolean("createChannelOnJoinCommand", true);
globalChannel = config.getString("globalChannel", "");
forceJoinChannels = config.getStringList("forceJoinChannels");
if ( forceJoinChannels == null ) {
// チャンネルチャット有効のときだけ、globalChannel設定を読み込む
// (see issue #58)
if ( enableChannelChat ) {
globalChannel = config.getString("globalChannel", "");
} else {
globalChannel = "";
}
// チャンネルチャット有効のときだけ、enableChannelChat設定を読み込む
// (see issue #58)
if ( enableChannelChat ) {
forceJoinChannels = config.getStringList("forceJoinChannels");
} else {
forceJoinChannels = new ArrayList<String>();
}
sendBroadcastChannelChatToDynmap =
config.getBoolean("sendBroadcastChannelChatToDynmap", true);
dynmapChannel = config.getString("dynmapChannel", "");
ngword = config.getStringList("ngword");
ngwordAction = NGWordAction.fromID(config.getString("ngwordAction", "mask"));
japanizeType = JapanizeType.fromID(config.getString("japanizeType", "kana"));
@@ -144,6 +163,14 @@ public class LunaChatConfig {
}
}
/**
* チャンネルチャット機能を利用可能にするかどうか
* @return enableChannelChatを返す
*/
public boolean isEnableChannelChat() {
return enableChannelChat;
}
/**
* チャンネルチャットに入っていない人の発言を、グローバルとして扱うかどうか
* @return noJoinAsGlobalを返す
@@ -235,6 +262,14 @@ public class LunaChatConfig {
return sendBroadcastChannelChatToDynmap;
}
/**
* dynmapのWebUIから発言された発言内容を表示するチャンネル。
* @return dynmapChannel dynmapの発言を表示するチャンネル名を返す
*/
public String getDynmapChannel() {
return dynmapChannel;
}
/**
* NGワードを発言した人に対して実行するアクション<br/>
* mask = マスクするのみ<br/>
+43 -1
ファイルの表示
@@ -6,14 +6,22 @@
package com.github.ucchyocean.lc.bridge;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import org.dynmap.DynmapAPI;
import org.dynmap.DynmapWebChatEvent;
import com.github.ucchyocean.lc.Channel;
import com.github.ucchyocean.lc.LunaChat;
import com.github.ucchyocean.lc.LunaChatAPI;
import com.github.ucchyocean.lc.LunaChatConfig;
/**
* dynmap連携クラス
* @author ucchy
*/
public class DynmapBridge {
public class DynmapBridge implements Listener {
/** dynmap-apiクラス */
private DynmapAPI dynmap;
@@ -56,4 +64,38 @@ public class DynmapBridge {
dynmap.sendBroadcastToWeb(null, message);
}
/**
* DynmapのWebUIからチャット発言されたときのイベント
* @param event
*/
@EventHandler
public void onDynmapWebChat(DynmapWebChatEvent event) {
LunaChatAPI api = LunaChat.instance.getLunaChatAPI();
LunaChatConfig config = LunaChat.instance.getLunaChatConfig();
String dchannel = config.getDynmapChannel();
Channel channel = null;
if ( !dchannel.equals("") ) {
// dynmapChannelが設定されている場合
channel = api.getChannel(dchannel);
} else {
String gchannel = config.getGlobalChannel();
if ( !gchannel.equals("") ) {
// dynmapChannelが設定されていなくて、
// globalChannelが設定されている場合
channel = api.getChannel(gchannel);
}
}
if ( channel != null ) {
// チャンネルへ送信
channel.chatFromOtherSource(
event.getName(), event.getSource(), event.getMessage());
event.setProcessed();
}
}
}
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class AcceptCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class BanCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -39,6 +39,16 @@ public class CreateCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -39,6 +39,16 @@ public class DenyCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class FormatCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+157
ファイルの表示
@@ -0,0 +1,157 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
*/
package com.github.ucchyocean.lc.command;
import java.util.ArrayList;
import org.bukkit.command.CommandSender;
/**
* helpコマンドの実行クラス
* @author ucchy
*/
public class HelpCommand extends SubCommandAbst {
private static final String COMMAND_NAME = "help";
private static final String PERMISSION_NODE = "lunachat." + COMMAND_NAME;
private static final String USAGE_KEY = "usageHelp";
// 1ページに表示するコマンドヘルプの項目数
private static final int PAGE_ITEM_NUM = 6;
private ArrayList<SubCommandAbst> commands;
/**
* コンストラクタ
* @param commands
*/
public HelpCommand(ArrayList<SubCommandAbst> commands) {
this.commands = commands;
}
/**
* コマンドを取得します。
* @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) {
CommandType type = CommandType.USER;
int page = 1;
if ( args.length >= 2 &&
(args[1].equalsIgnoreCase("mod")
|| args[1].equalsIgnoreCase("moderator") ) ) {
type = CommandType.MODERATOR;
} else if ( args.length >= 2
&& args[1].equalsIgnoreCase("admin") ) {
type = CommandType.ADMIN;
}
if ( args.length >= 3 && args[2].matches("[1-9]") ) {
page = Integer.parseInt(args[2]);
}
printUsage(sender, label, type, page);
return true;
}
/**
* コマンドの使い方を senderに送る
* @param sender
* @param label
* @param type コマンド種別
* @param page ページ
*/
private void printUsage(CommandSender sender, String label,
CommandType type, int page) {
String typeDesc;
switch (type) {
case USER:
typeDesc = "user";
break;
case MODERATOR:
typeDesc = "moderator";
break;
case ADMIN:
typeDesc = "admin";
break;
default:
typeDesc = "user";
}
// 種別に該当するコマンドを取得
ArrayList<SubCommandAbst> com = new ArrayList<SubCommandAbst>();
for ( SubCommandAbst c : commands ) {
if ( c.getCommandType() == type
&& sender.hasPermission(c.getPermissionNode()) ) {
com.add(c);
}
}
int lastPage = ( (com.size() - 1) / PAGE_ITEM_NUM) + 1;
// 表示処理
sendResourceMessage(sender, "", "usageTop", typeDesc, page, lastPage);
for (int index=(page-1)*PAGE_ITEM_NUM; index<page*PAGE_ITEM_NUM; index++) {
if ( index >= com.size() ) break;
com.get(index).sendUsageMessage(sender, label);
}
sendResourceMessage(sender, "", "usageFoot");
if ( page < lastPage ) {
sendResourceMessage(sender, "", "usageNoticeNextPage", typeDesc, (page + 1));
}
}
}
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class HideCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -42,6 +42,16 @@ public class InfoCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class InviteCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class JoinCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class KickCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class LeaveCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -49,6 +49,16 @@ public class ListCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+12 -15
ファイルの表示
@@ -11,6 +11,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.github.ucchyocean.lc.LunaChat;
import com.github.ucchyocean.lc.Resources;
/**
@@ -23,6 +24,7 @@ public class LunaChatCommand implements CommandExecutor {
private ArrayList<SubCommandAbst> commands;
private JoinCommand joinCommand;
private HelpCommand helpCommand;
/**
* コンストラクタ
@@ -53,6 +55,8 @@ public class LunaChatCommand implements CommandExecutor {
commands.add(new OptionCommand());
commands.add(new TemplateCommand());
commands.add(new ReloadCommand());
helpCommand = new HelpCommand(commands);
commands.add(helpCommand);
}
/**
@@ -62,9 +66,16 @@ public class LunaChatCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
// チャンネルチャット機能が無効になっている場合は、メッセージを表示して終了
if ( !LunaChat.instance.getLunaChatConfig().isEnableChannelChat()
&& !sender.isOp() ) {
sendResourceMessage(sender, PREERR, "errmsgChannelChatDisabled");
return true;
}
// 引数なしは、ヘルプを表示
if (args.length == 0) {
printUsage(sender, label);
helpCommand.runCommand(sender, label, args);
return true;
}
@@ -94,20 +105,6 @@ public class LunaChatCommand implements CommandExecutor {
return joinCommand.runCommand(sender, label, args);
}
/**
* コマンドの使い方を senderに送る
*
* @param sender
* @param label
*/
private void printUsage(CommandSender sender, String label) {
for ( SubCommandAbst c : commands ) {
if ( sender.hasPermission(c.getPermissionNode()) ) {
c.sendUsageMessage(sender, label);
}
}
}
/**
* メッセージリソースのメッセージを、カラーコード置き換えしつつ、senderに送信する
*
+10
ファイルの表示
@@ -42,6 +42,16 @@ public class ModeratorCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class MuteCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -49,6 +49,16 @@ public class OptionCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class PardonCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -37,6 +37,16 @@ public class ReloadCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.ADMIN;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class RemoveCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+21
ファイルの表示
@@ -18,6 +18,22 @@ import com.github.ucchyocean.lc.Resources;
*/
public abstract class SubCommandAbst {
/**
* コマンドの種別
* @author ucchy
*/
protected enum CommandType {
/** 一般ユーザー向けコマンド */
USER,
/** チャンネルモデレーター向けコマンド */
MODERATOR,
/** サーバー管理者向けコマンド */
ADMIN
}
protected static final String PREINFO = Resources.get("infoPrefix");
protected static final String PREERR = Resources.get("errorPrefix");
@@ -59,6 +75,11 @@ public abstract class SubCommandAbst {
*/
public abstract String getPermissionNode();
/**
* コマンドの種別を取得します。
* @return コマンド種別
*/
public abstract CommandType getCommandType();
/**
* 使用方法に関するメッセージをsenderに送信します。
+10
ファイルの表示
@@ -37,6 +37,16 @@ public class TemplateCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.ADMIN;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -40,6 +40,16 @@ public class UnhideCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.USER;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+10
ファイルの表示
@@ -41,6 +41,16 @@ public class UnmuteCommand extends SubCommandAbst {
return PERMISSION_NODE;
}
/**
* コマンドの種別を取得します。
* @return コマンド種別
* @see com.github.ucchyocean.lc.command.SubCommandAbst#getCommandType()
*/
@Override
public CommandType getCommandType() {
return CommandType.MODERATOR;
}
/**
* 使用方法に関するメッセージをsenderに送信します。
* @param sender コマンド実行者
+43
ファイルの表示
@@ -0,0 +1,43 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
*/
package com.github.ucchyocean.lc.event;
import org.bukkit.event.Cancellable;
/**
* 基底のキャンセル可能イベントクラス
* @author ucchy
*/
public class LunaChatBaseCancellableEvent extends LunaChatBaseEvent implements Cancellable {
private boolean isCancelled;
/**
* コンストラクタ
* @param channelName チャンネル名
*/
public LunaChatBaseCancellableEvent(String channelName) {
super(channelName);
}
/**
* イベントがキャンセルされたかどうかをかえす
* @see org.bukkit.event.Cancellable#isCancelled()
*/
@Override
public boolean isCancelled() {
return isCancelled;
}
/**
* イベントをキャンセルするかどうかを設定する
* @see org.bukkit.event.Cancellable#setCancelled(boolean)
*/
@Override
public void setCancelled(boolean cancelled) {
isCancelled = cancelled;
}
}
+6 -13
ファイルの表示
@@ -5,7 +5,6 @@
*/
package com.github.ucchyocean.lc.event;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
@@ -13,16 +12,20 @@ import org.bukkit.event.HandlerList;
* 基底イベントクラス
* @author ucchy
*/
public abstract class LunaChatBaseEvent extends Event implements Cancellable {
public abstract class LunaChatBaseEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private boolean isCancelled;
protected String channelName;
/**
* コンストラクタ
* @param channelName チャンネル名
*/
public LunaChatBaseEvent(String channelName) {
this.channelName = channelName;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
@@ -31,16 +34,6 @@ public abstract class LunaChatBaseEvent extends Event implements Cancellable {
return handlers;
}
@Override
public boolean isCancelled() {
return isCancelled;
}
@Override
public void setCancelled(boolean cancelled) {
isCancelled = cancelled;
}
/**
* @return チャンネル名
*/
+21 -2
ファイルの表示
@@ -9,7 +9,7 @@ package com.github.ucchyocean.lc.event;
* チャンネルチャットのチャットイベント
* @author ucchy
*/
public class LunaChatChannelChatEvent extends LunaChatBaseEvent {
public class LunaChatChannelChatEvent extends LunaChatBaseCancellableEvent {
private String originalMessage;
private String ngMaskedMessage;
@@ -24,23 +24,42 @@ public class LunaChatChannelChatEvent extends LunaChatBaseEvent {
this.messageFormat = messageFormat;
}
/**
* 置き換え前の、発言されたままのテキストをかえす
* @return 発言内容
*/
public String getPreReplaceMessage() {
return originalMessage;
}
/**
* NGワードがマスクされた後のテキストをかえす
* @return NGワードマスク済みの発言内容
*/
public String getNgMaskedMessage() {
return ngMaskedMessage;
}
/**
* メッセージに適用されるフォーマットをかえす
* @return フォーマット
*/
public String getMessageFormat() {
return messageFormat;
}
/**
* NGワードマスク後のテキストを上書き設定する
* @param ngMaskedMessage 上書きする発言内容
*/
public void setNgMaskedMessage(String ngMaskedMessage) {
this.ngMaskedMessage = ngMaskedMessage;
}
/**
* メッセージフォーマットを上書き設定する
* @param messageFormat フォーマット
*/
public void setMessageFormat(String messageFormat) {
this.messageFormat = messageFormat;
}
+2 -1
ファイルの表示
@@ -9,13 +9,14 @@ package com.github.ucchyocean.lc.event;
* チャンネル作成イベント
* @author ucchy
*/
public class LunaChatChannelCreateEvent extends LunaChatBaseEvent {
public class LunaChatChannelCreateEvent extends LunaChatBaseCancellableEvent {
public LunaChatChannelCreateEvent(String channelName) {
super(channelName);
}
/**
* 作成するチャンネルのチャンネル名を上書き設定する
* @param channelName 設定するチャンネル名
*/
protected void setChannelName(String channelName) {
+5 -1
ファイルの表示
@@ -11,7 +11,7 @@ import java.util.List;
* メンバー変更イベント
* @author ucchy
*/
public class LunaChatChannelMemberChangedEvent extends LunaChatBaseEvent {
public class LunaChatChannelMemberChangedEvent extends LunaChatBaseCancellableEvent {
private List<String> members;
@@ -20,6 +20,10 @@ public class LunaChatChannelMemberChangedEvent extends LunaChatBaseEvent {
this.members = members;
}
/**
* 変更後のメンバーリストをかえす
* @return
*/
public List<String> getMembers() {
return members;
}
+70
ファイルの表示
@@ -0,0 +1,70 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
*/
package com.github.ucchyocean.lc.event;
import java.util.ArrayList;
import org.bukkit.entity.Player;
/**
* チャンネルチャットのメッセージイベント、
* このイベントはキャンセルできない。
* @author ucchy
*/
public class LunaChatChannelMessageEvent extends LunaChatBaseEvent {
private Player player;
private String message;
private ArrayList<Player> recipients;
public LunaChatChannelMessageEvent(String channelName,
Player player, String message, ArrayList<Player> recipients) {
super(channelName);
this.player = player;
this.message = message;
this.recipients = recipients;
}
/**
* 発言したプレイヤー、システムメッセージの場合はnullになることに注意
* @return player 発言プレイヤー
*/
public Player getPlayer() {
return player;
}
/**
* 置き換えされたメッセージ
* @return message メッセージ
*/
public String getMessage() {
return message;
}
/**
* メッセージを受信するプレイヤーリスト
* @return recipients プレイヤーリスト
*/
public ArrayList<Player> getRecipients() {
return recipients;
}
/**
* メッセージを上書き設定する
* @param message メッセージ
*/
public void setMessage(String message) {
this.message = message;
}
/**
* メッセージ受信者を上書き設定する
* @param recipients メッセージ受信者
*/
public void setRecipients(ArrayList<Player> recipients) {
this.recipients = recipients;
}
}
+9 -1
ファイルの表示
@@ -11,7 +11,7 @@ import java.util.HashMap;
* オプション変更イベント
* @author ucchy
*/
public class LunaChatChannelOptionChangedEvent extends LunaChatBaseEvent {
public class LunaChatChannelOptionChangedEvent extends LunaChatBaseCancellableEvent {
private HashMap<String, String> options;
@@ -21,10 +21,18 @@ public class LunaChatChannelOptionChangedEvent extends LunaChatBaseEvent {
this.options = options;
}
/**
* 変更後のオプションリストをかえす
* @return オプションリスト
*/
public HashMap<String, String> getOptions() {
return options;
}
/**
* オプションリストを上書き設定する
* @param options オプションリスト
*/
public void setOptions(HashMap<String, String> options) {
this.options = options;
}
+1 -1
ファイルの表示
@@ -9,7 +9,7 @@ package com.github.ucchyocean.lc.event;
* チャンネル削除イベント
* @author ucchy
*/
public class LunaChatChannelRemoveEvent extends LunaChatBaseEvent {
public class LunaChatChannelRemoveEvent extends LunaChatBaseCancellableEvent {
public LunaChatChannelRemoveEvent(String channelName) {
super(channelName);
+1 -1
ファイルの表示
@@ -9,7 +9,7 @@ package com.github.ucchyocean.lc.event;
* Japanize変換が行われた後に呼び出されるイベント
* @author ucchy
*/
public class LunaChatPostJapanizeEvent extends LunaChatBaseEvent {
public class LunaChatPostJapanizeEvent extends LunaChatBaseCancellableEvent {
private String original;
private String japanized;
-24
ファイルの表示
@@ -1,24 +0,0 @@
# LunaChat v2.5.0
# @author ucchy
# @license LGPLv3
# @copyright Copyright ucchy 2013
noJoinAsGlobal: true
loggingChat: true
displayChatOnConsole: false
globalMarker: '!'
zeroMemberRemove: false
showListOnJoin: false
createChannelOnJoinCommand: true
globalChannel: ''
forceJoinChannels: []
sendBroadcastChannelChatToDynmap: true
ngword: []
ngwordAction: mask
japanizeType: GoogleIME
japanizeDisplayLine: 1
japanizeLine1Format: '%msg &7(%japanize)'
japanizeLine2Format: '&6[JP] %japanize'
noneJapanizeMarker: '#'
+15 -2
ファイルの表示
@@ -1,10 +1,14 @@
# LunaChat v2.5.0
# LunaChat v2.5.2
# @author ucchy
# @license LGPLv3
# @copyright Copyright ucchy 2013
# -------------------- 一般設定 --------------------
# -------------------- チャンネルチャット設定 --------------------
# チャンネルチャット機能を利用可能にするかどうか
# Japanize機能のみを利用したい場合は、falseにしてください。
enableChannelChat: true
# チャンネルチャットに入っていない人の発言を、グローバルとして扱うかどうか
noJoinAsGlobal: true
@@ -37,10 +41,19 @@ globalChannel: ''
# 複数のチャンネルを設定可能。例)forceJoinChannels: ['L', 'M', 'N']
forceJoinChannels: []
# -------------------- dynmap連携設定 --------------------
# ブロードキャストチャンネルの発言内容を、dynmapに送信するかどうか。
# dynmapがロードされていない場合は、この設定は無視される(false扱い)。
sendBroadcastChannelChatToDynmap: true
# dynmapのWebUIから発言された発言内容を表示するチャンネル。
# dynmapChannelが無指定で、globalChannelが指定されているなら、グローバルチャンネルに、
# dynmapChannelが無指定で、globalChannelも無指定なら、通常チャットに発言される。
dynmapChannel: ''
# -------------------- NGワード設定 --------------------
+32 -26
ファイルの表示
@@ -109,35 +109,41 @@ errmsgInvalidRangeOption: 'range に正しくない値が指定されました
errmsgCannotOffGlobalBroadcast: 'このチャンネルはグローバルチャンネルのため、ブロードキャストをオフにできません。'
errmsgNotPermission: 'パーミッション "%s" が無いため、実行できません。'
errmsgChannelChatDisabled: 'このサーバーでは、チャンネルチャットは動作しません。'
ngwordPrefix: 'NGワード発言により、'
usageJoin: '&7/%s join (channel) - チャンネルに参加します。'
usageLeave: '&7/%s leave - 参加しているチャンネルから退出します。'
usageList: '&7/%s list - チャンネルのリストを表示します。'
usageInvite: '&7/%s invite (name) - 指定した人をチャンネルチャットに招待します。'
usageAccept: '&7/%s accept - 招待を受けてチャンネルチャットに入室します。'
usageDeny: '&7/%s deny - 招待を拒否します。'
usageKick: '&7/%s kick (name) - 指定した人をチャンネルチャットからキックします。'
usageBan: '&7/%s ban (name) - 指定した人をチャンネルチャットからBANします。'
usagePardon: '&7/%s pardon (name) - 指定した人のBANを解除します。'
usageMute: '&7/%s mute (name) - 指定した人のチャンネルでの発言権を剥奪します。'
usageUnmute: '&7/%s unmute (name) - 指定した人のチャンネルでの発言権剥奪を解除します。'
usageHide: '&7/%s hide [channel] - 指定したチャンネルの発言内容を非表示にします。指定を省略すると、現在自分が居るチャンネルが非表示になります。'
usageUnhide: '&7/%s unhide [channel] - 指定したチャンネルの発言内容を表示に戻します。'
usageInfo: '&7/%s info [channel] - チャンネルの情報を表示します。'
usageJoin: '&6/%s join (channel) &7- チャンネルに参加します。'
usageLeave: '&6/%s leave &7- 参加しているチャンネルから退出します。'
usageList: '&6/%s list &7- チャンネルのリストを表示します。'
usageInvite: '&6/%s invite (name) &7- 指定した人をチャンネルチャットに招待します。'
usageAccept: '&6/%s accept &7- 招待を受けてチャンネルチャットに入室します。'
usageDeny: '&6/%s deny &7- 招待を拒否します。'
usageKick: '&6/%s kick (name) &7- 指定した人をチャンネルチャットからキックします。'
usageBan: '&6/%s ban (name) &7- 指定した人をチャンネルチャットからBANします。'
usagePardon: '&6/%s pardon (name) &7- 指定した人のBANを解除します。'
usageMute: '&6/%s mute (name) &7- 指定した人のチャンネルでの発言権を剥奪します。'
usageUnmute: '&6/%s unmute (name) &7- 指定した人のチャンネルでの発言権剥奪を解除します。'
usageHide: '&6/%s hide [channel] &7- 指定したチャンネルの発言内容を非表示にします。'
usageUnhide: '&6/%s unhide [channel] &7- 指定したチャンネルの発言内容を非表示から表示に戻します。'
usageInfo: '&6/%s info [channel] &7- チャンネルの情報を表示します。'
usageCreate: '&7/%s create (channel) [description] - チャンネルを作成します。'
usageRemove: '&7/%s remove [channel] - チャンネルを削除します。'
usageFormat: '&7/%s format [channel] (format...) - チャンネルのメッセージフォーマットを設定します。'
usageModerator: '&7/%s moderator [channel] (player) - チャンネルのモデレーターを指定したプレイヤーに設定します。'
usageMod: '&7/%s mod [channel] (player) - チャンネルのモデレーターを指定したプレイヤーに設定します。'
usageOption: '&7/%s option [channel] (key=value...) - チャンネルのオプションを設定します。'
usageTemplate: '&7/%s template (number) (template...) - メッセージフォーマットのテンプレートを登録します。'
usageReload: '&7/%s reload - config.ymlの再読み込みをします。'
usageCreate: '&6/%s create (channel) [description] &7- チャンネルを作成します。'
usageRemove: '&6/%s remove [channel] &7- チャンネルを削除します。'
usageFormat: '&6/%s format [channel] (format...) &7- チャンネルのメッセージフォーマットを設定します。'
usageModerator: '&6/%s moderator [channel] (player) &7- チャンネルのモデレーターを指定したプレイヤーに設定します。'
usageMod: '&6/%s mod [channel] (player) &7- チャンネルのモデレーターを指定したプレイヤーに設定します。'
usageOption: '&6/%s option [channel] (key=value...) &7- チャンネルのオプションを設定します。'
usageTemplate: '&6/%s template (number) (template...) &7- メッセージフォーマットのテンプレートを登録します。'
usageReload: '&6/%s reload &7- config.ymlの再読み込みをします。'
usageHelp: '&6/%s help [user|mod|admin] [page] &7- ヘルプを表示します。'
usageMessage: '&7/%s (name) [message] - 指定した人との1:1チャットを開始します。'
usageReply: '&7/%s [message] - 受信した1:1チャットに返信します。'
usageMessage: '&6/%s (name) [message] &7- 指定した人との1:1チャットを開始します。'
usageReply: '&6/%s [message] &7- 受信した1:1チャットに返信します。'
usageJapanize: '&7/%s on|off - Turn on/off the Japanize conversion of your chat.'
usageJapanizeOther: '&7/%s (player) on|off - Turn on/off the Japanize conversion of other player''s chat.'
usageJapanize: '&6/%s on|off &7- Turn on/off the Japanize conversion of your chat.'
usageJapanizeOther: '&6/%s (player) on|off &7- Turn on/off the Japanize conversion of other player''s chat.'
usageTop: '&e----- &6LunaChat %s command (&c%d&6/&c%d&6) &e-----'
usageFoot: '&e-----------------------------------------'
usageNoticeNextPage: '&6次のページを見るには、&c/ch help %s %d&6 と実行してください。'
+8 -3
ファイルの表示
@@ -1,6 +1,6 @@
name: LunaChat
main: com.github.ucchyocean.lc.LunaChat
version: 2.5.0
version: 2.5.2
author: ucchy
description: チャンネルチャットプラグイン
softdepend: [Vault, dynmap]
@@ -21,7 +21,7 @@ commands:
/<command> mute (name) - 指定した人をチャンネルチャットからMuteします。
/<command> unmute (name) - 指定した人のMuteを解除します。
/<command> hide [channel] - 指定したチャンネルの発言内容を非表示にします。指定を省略すると、現在自分が居るチャンネルが非表示になります。
/<command> unhide [channel] - 指定したチャンネルの発言内容を表示に戻します。
/<command> unhide [channel] - 指定したチャンネルの発言内容を非表示から表示に戻します。
/<command> info [channel] - チャンネルの情報を表示します。
/<command> create (channel) - チャンネルを作成します。
/<command> remove [channel] - チャンネルを削除します。
@@ -30,9 +30,10 @@ commands:
/<command> option (key=value...) - チャンネルのオプションを設定します。
/<command> template (number) (template...) - メッセージフォーマットのテンプレートを登録します。
/<command> reload - config.ymlの再読み込みをします。
/<command> help [user|mod|admin] [page] - ヘルプを表示します。
message:
description: 1:1チャット送信コマンド
aliases: [msg, tell]
aliases: [msg, tell, m, t]
usage: /<command> (name) [message] - 指定した人との1:1チャットを開始します。
permission: lunachat.message
permission-message: パーミッション "<permission>" が無いため、実行できません。
@@ -114,6 +115,9 @@ permissions:
lunachat.reply:
description: replyコマンドの使用権限
default: true
lunachat.help:
description: helpコマンドの使用権限
default: true
lunachat.japanize:
description: lunachatのjapanizeオンオフ設定コマンドの使用権限
default: true
@@ -140,6 +144,7 @@ permissions:
lunachat.option: true
lunachat.message: true
lunachat.reply: true
lunachat.help: true
lunachat.japanize: true
description: 一般ユーザー向けの全コマンドの使用権限
lunachat-admin.template: