LunaChat v3-k2 : Implement Backward Compatibility. (WIP)
このコミットが含まれているのは:
1 親
a08c043055
コミット
172e64aa50
27ファイル変更
+2364
-24
検索条件に一致するファイルはありません
@@ -7,8 +7,8 @@ package com.github.ucchyocean.lc3;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.github.ucchyocean.lc3.channel.Channel;
|
||||
import com.github.ucchyocean.lc3.japanize.JapanizeType;
|
||||
@@ -74,13 +74,13 @@ public interface LunaChatAPI {
|
||||
*/
|
||||
public Channel createChannel(String channelName);
|
||||
|
||||
// /**
|
||||
// * 新しいチャンネルを作成する
|
||||
// * @param channelName チャンネル名
|
||||
// * @param sender チャンネルを作成した人
|
||||
// * @return 作成されたチャンネル
|
||||
// */
|
||||
// public Channel createChannel(String channelName, CommandSender sender);
|
||||
/**
|
||||
* 新しいチャンネルを作成する
|
||||
* @param channelName チャンネル名
|
||||
* @param member チャンネルを作成した人
|
||||
* @return 作成されたチャンネル
|
||||
*/
|
||||
public Channel createChannel(String channelName, ChannelMember member);
|
||||
|
||||
/**
|
||||
* チャンネルを削除する
|
||||
@@ -89,13 +89,13 @@ public interface LunaChatAPI {
|
||||
*/
|
||||
public boolean removeChannel(String channelName);
|
||||
|
||||
// /**
|
||||
// * チャンネルを削除する
|
||||
// * @param channelName 削除するチャンネル名
|
||||
// * @param sender チャンネルを削除した人
|
||||
// * @return 削除したかどうか
|
||||
// */
|
||||
// public boolean removeChannel(String channelName, CommandSender sender);
|
||||
/**
|
||||
* チャンネルを削除する
|
||||
* @param channelName 削除するチャンネル名
|
||||
* @param member チャンネルを削除した人
|
||||
* @return 削除したかどうか
|
||||
*/
|
||||
public boolean removeChannel(String channelName, ChannelMember member);
|
||||
|
||||
/**
|
||||
* テンプレートを取得する
|
||||
@@ -121,7 +121,7 @@ public interface LunaChatAPI {
|
||||
* 辞書データを全て取得する
|
||||
* @return 辞書データ
|
||||
*/
|
||||
public HashMap<String, String> getAllDictionary();
|
||||
public Map<String, String> getAllDictionary();
|
||||
|
||||
/**
|
||||
* 新しい辞書データを追加する
|
||||
|
||||
@@ -33,9 +33,6 @@ public class Utility {
|
||||
public static void copyFileFromJar(
|
||||
File jarFile, File targetFile, String sourceFilePath, boolean isBinary) {
|
||||
|
||||
// でばっぐ
|
||||
System.out.println(jarFile + " - " + targetFile + " - " + sourceFilePath);
|
||||
|
||||
File parent = targetFile.getParentFile();
|
||||
if (!parent.exists()) {
|
||||
parent.mkdirs();
|
||||
|
||||
@@ -50,7 +50,9 @@ public class BukkitChannel extends Channel {
|
||||
* @param name チャンネル名
|
||||
*/
|
||||
protected BukkitChannel(String name) {
|
||||
|
||||
super(name);
|
||||
|
||||
dateFormat = new SimpleDateFormat("yyyy/MM/dd");
|
||||
timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class BungeeChannel extends Channel {
|
||||
String node = PERMISSION_SPEAK_PREFIX + "." + getName();
|
||||
if ( player.isPermissionSet(node) && !player.hasPermission(node) ) {
|
||||
player.sendMessage(Messages.errmsgPermission(node));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
LunaChatConfig config = LunaChat.getConfig();
|
||||
|
||||
@@ -386,6 +386,18 @@ public class ChannelManager implements LunaChatAPI {
|
||||
*/
|
||||
@Override
|
||||
public Channel createChannel(String channelName) {
|
||||
return createChannel(channelName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新しいチャンネルを作成する
|
||||
* @param channelName チャンネル名
|
||||
* @param member チャンネルを作成した人
|
||||
* @return 作成されたチャンネル
|
||||
* @see com.github.ucchyocean.lc3.LunaChatAPI#createChannel(java.lang.String, com.github.ucchyocean.lc3.member.ChannelMember)
|
||||
*/
|
||||
@Override
|
||||
public Channel createChannel(String channelName, ChannelMember member) {
|
||||
|
||||
// イベントコール
|
||||
// LunaChatChannelCreateEvent event =
|
||||
@@ -418,6 +430,18 @@ public class ChannelManager implements LunaChatAPI {
|
||||
*/
|
||||
@Override
|
||||
public boolean removeChannel(String channelName) {
|
||||
return removeChannel(channelName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルを削除する
|
||||
* @param channelName 削除するチャンネル名
|
||||
* @param member チャンネルを削除した人
|
||||
* @return 削除したかどうか
|
||||
* @see com.github.ucchyocean.lc3.LunaChatAPI#removeChannel(java.lang.String, com.github.ucchyocean.lc3.member.ChannelMember)
|
||||
*/
|
||||
@Override
|
||||
public boolean removeChannel(String channelName, ChannelMember member) {
|
||||
|
||||
channelName = channelName.toLowerCase();
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.github.ucchyocean.lc3.channel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -57,7 +58,7 @@ public class JapanizeConvertTask {
|
||||
if ( LunaChat.getConfig().isJapanizeIgnorePlayerName() ) {
|
||||
keywords.addAll(LunaChat.getPlugin().getOnlinePlayerNames());
|
||||
}
|
||||
HashMap<String, String> dictionary =
|
||||
Map<String, String> dictionary =
|
||||
LunaChat.getAPI().getAllDictionary();
|
||||
|
||||
// カラーコード削除、URL削除
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3.command;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.github.ucchyocean.lc3.ChatColor;
|
||||
import com.github.ucchyocean.lc3.Messages;
|
||||
@@ -122,7 +122,7 @@ public class DictionaryCommand extends LunaChatSubCommand {
|
||||
|
||||
} else if ( args[1].equalsIgnoreCase("view") ) {
|
||||
|
||||
HashMap<String, String> dic = api.getAllDictionary();
|
||||
Map<String, String> dic = api.getAllDictionary();
|
||||
for ( String key : dic.keySet() ) {
|
||||
String value = dic.get(key);
|
||||
sender.sendMessage(key + ChatColor.GRAY + " -> " + ChatColor.WHITE + value);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package com.github.ucchyocean.lc3.japanize;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ローマ字表記を漢字変換して返すユーティリティ
|
||||
@@ -23,7 +24,7 @@ public class Japanizer {
|
||||
* @return
|
||||
*/
|
||||
public static String japanize(String org, JapanizeType type,
|
||||
HashMap<String, String> dictionary) {
|
||||
Map<String, String> dictionary) {
|
||||
|
||||
// 変換不要なら空文字列を返す
|
||||
if ( type == JapanizeType.NONE || !isNeedToJapanize(org) ) {
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする