LunaChat v3-k2 : initial revision.

このコミットが含まれているのは:
ucchy committed 2020-05-25 10:06:07 +09:00
1 親 7fdb159cff
コミット 5ddd0959d8
78ファイル変更
+215 -606

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

+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -32
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
@@ -15,10 +15,8 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import com.github.ucchyocean.lc.bridge.DynmapBridge;
import com.github.ucchyocean.lc.bridge.HawkEyeBridge;
import com.github.ucchyocean.lc.bridge.McMMOBridge;
import com.github.ucchyocean.lc.bridge.MultiverseCoreBridge;
import com.github.ucchyocean.lc.bridge.PrismBridge;
import com.github.ucchyocean.lc.bridge.VaultChatBridge;
import com.github.ucchyocean.lc.channel.ChannelManager;
import com.github.ucchyocean.lc.command.LunaChatCommand;
@@ -39,9 +37,7 @@ public class LunaChat extends JavaPlugin {
private VaultChatBridge vaultchat;
private DynmapBridge dynmap;
private HawkEyeBridge hawkeye;
private MultiverseCoreBridge multiverse;
private PrismBridge prism;
private ExpireCheckTask expireCheckerTask;
private LunaChatLogger normalChatLogger;
@@ -83,12 +79,6 @@ public class LunaChat extends JavaPlugin {
}
}
// HawkEye のロード
temp = getServer().getPluginManager().getPlugin("HawkEye");
if ( temp != null ) {
hawkeye = HawkEyeBridge.load(temp);
}
// MultiverseCore のロード
temp = getServer().getPluginManager().getPlugin("Multiverse-Core");
if ( temp != null ) {
@@ -100,11 +90,6 @@ public class LunaChat extends JavaPlugin {
getServer().getPluginManager().registerEvents(new McMMOBridge(), this);
}
// Prismのロード
if ( getServer().getPluginManager().isPluginEnabled("Prism") ) {
prism = PrismBridge.load();
}
// リスナーの登録
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
@@ -222,14 +207,6 @@ public class LunaChat extends JavaPlugin {
return dynmap;
}
/**
* HawkEye連携クラスを返す
* @return HawkEyeBridge
*/
public HawkEyeBridge getHawkEye() {
return hawkeye;
}
/**
* MultiverseCore連携クラスを返す
* @return MultiverseCoreBridge
@@ -238,14 +215,6 @@ public class LunaChat extends JavaPlugin {
return multiverse;
}
/**
* Prism連携クラスを返す
* @return MultiverseCoreBridge
*/
public PrismBridge getPrism() {
return prism;
}
/**
* 通常チャット用のロガーを返す
* @return normalChatLogger
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
+49 -264
ファイルの表示
@@ -1,38 +1,31 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
/**
* ユーティリティクラス
* @author ucchy
*/
public class Utility {
private static Boolean isCB178orLaterCache;
private static Boolean isCB19orLaterCache;
public static final char COLOR_CHAR = '\u00A7';
private static final Pattern STRIP_COLOR_PATTERN =
Pattern.compile("(?i)" + String.valueOf(COLOR_CHAR) + "[0-9A-FK-OR]");
/**
* jarファイルの中に格納されているファイルを、jarファイルの外にコピーするメソッド
@@ -44,91 +37,39 @@ public class Utility {
public static void copyFileFromJar(
File jarFile, File targetFile, String sourceFilePath, boolean isBinary) {
JarFile jar = null;
InputStream is = null;
FileOutputStream fos = null;
BufferedReader reader = null;
BufferedWriter writer = null;
File parent = targetFile.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
try {
jar = new JarFile(jarFile);
try ( JarFile jar = new JarFile(jarFile) ) {
ZipEntry zipEntry = jar.getEntry(sourceFilePath);
is = jar.getInputStream(zipEntry);
InputStream is = jar.getInputStream(zipEntry);
fos = new FileOutputStream(targetFile);
try ( FileOutputStream fos = new FileOutputStream(targetFile) ) {
if (isBinary) {
byte[] buf = new byte[8192];
int len;
while ((len = is.read(buf)) != -1) {
fos.write(buf, 0, len);
}
if (isBinary) {
byte[] buf = new byte[8192];
int len;
while ((len = is.read(buf)) != -1) {
fos.write(buf, 0, len);
}
} else {
reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
// CB190以降は、書き出すファイルエンコードにUTF-8を強制する。see issue #141.
if ( isCB19orLater() ) {
writer = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8"));
} else {
writer = new BufferedWriter(new OutputStreamWriter(fos));
}
String line;
while ((line = reader.readLine()) != null) {
writer.write(line);
writer.newLine();
}
try ( BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8")) ) {
String line;
while ((line = reader.readLine()) != null) {
writer.write(line);
writer.newLine();
}
}
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (jar != null) {
try {
jar.close();
} catch (IOException e) {
// do nothing.
}
}
if (writer != null) {
try {
writer.flush();
writer.close();
} catch (IOException e) {
// do nothing.
}
}
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
// do nothing.
}
}
if (fos != null) {
try {
fos.flush();
fos.close();
} catch (IOException e) {
// do nothing.
}
}
if (is != null) {
try {
is.close();
} catch (IOException e) {
// do nothing.
}
}
}
}
@@ -138,9 +79,15 @@ public class Utility {
* @return 置き換え後の文字列
*/
public static String replaceColorCode(String source) {
if (source == null)
return null;
return ChatColor.translateAlternateColorCodes('&', source);
if (source == null) return null;
char[] b = source.toCharArray();
for (int i = 0; i < b.length - 1; i++) {
if (b[i] == '&' && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[i + 1]) > -1) {
b[i] = COLOR_CHAR;
b[i + 1] = Character.toLowerCase(b[i + 1]);
}
}
return new String(b);
}
/**
@@ -149,9 +96,18 @@ public class Utility {
* @return 置き換え後の文字列
*/
public static String stripColor(String source) {
if (source == null)
return null;
return ChatColor.stripColor(source);
if (source == null) return null;
return STRIP_COLOR_PATTERN.matcher(source).replaceAll("");
}
/**
* カラーコード(§a)かどうかを判断する
* @param code カラーコード
* @return カラーコードかどうか
*/
public static boolean isColorCode(String code) {
if (code == null) return false;
return code.matches(COLOR_CHAR + "[0-9a-fA-F]");
}
/**
@@ -168,183 +124,12 @@ public class Utility {
}
/**
* カラー表記の文字列を、ChatColorクラスに変換する
* @param color カラー表記の文字列
* @return ChatColorクラス
* 指定された名前のプレイヤーが接続したことがあるかどうかを検索する
* @param name プレイヤー名
* @return 接続したことがあるかどうか
*/
public static ChatColor changeToChatColor(String color) {
if (isValidColor(color)) {
return ChatColor.valueOf(color.toUpperCase());
}
return ChatColor.WHITE;
}
/**
* カラー表記の文字列を、カラーコードに変換する
* @param color カラー表記の文字列
* @return カラーコード
*/
public static String changeToColorCode(String color) {
return "&" + changeToChatColor(color).getChar();
}
/**
* ChatColorで指定可能な色かどうかを判断する
* @param color カラー表記の文字列
* @return 指定可能かどうか
*/
public static boolean isValidColor(String color) {
for (ChatColor c : ChatColor.values()) {
if (c.name().equals(color.toUpperCase())) {
return true;
}
}
public static boolean existsOfflinePlayer(String name) {
// TODO 未実装
return false;
}
/**
* カラーコードかどうかを判断する
* @param color カラー表記の文字列
* @return 指定可能かどうか
*/
public static boolean isValidColorCode(String code) {
if (code == null) {
return false;
}
return code.matches("&[0-9a-f]");
}
/**
* 現在動作中のCraftBukkitが、v1.7.8 以上かどうかを確認する
* @return v1.7.8以上ならtrue、そうでないならfalse
*/
public static boolean isCB178orLater() {
if ( isCB178orLaterCache == null ) {
isCB178orLaterCache = isUpperVersion(Bukkit.getBukkitVersion(), "1.7.8");
}
return isCB178orLaterCache;
}
/**
* 現在動作中のCraftBukkitが、v1.9 以上かどうかを確認する
* @return v1.9以上ならtrue、そうでないならfalse
*/
public static boolean isCB19orLater() {
if ( isCB19orLaterCache == null ) {
isCB19orLaterCache = isUpperVersion(Bukkit.getBukkitVersion(), "1.9");
}
return isCB19orLaterCache;
}
/**
* 指定されたバージョンが、基準より新しいバージョンかどうかを確認する
* @param version 確認するバージョン
* @param border 基準のバージョン
* @return 基準より確認対象の方が新しいバージョンかどうか<br/>
* ただし、無効なバージョン番号(数値でないなど)が指定された場合はfalseに、
* 2つのバージョンが完全一致した場合はtrueになる。
*/
public static boolean isUpperVersion(String version, String border) {
int hyphen = version.indexOf("-");
if ( hyphen > 0 ) {
version = version.substring(0, hyphen);
}
String[] versionArray = version.split("\\.");
int[] versionNumbers = new int[versionArray.length];
for ( int i=0; i<versionArray.length; i++ ) {
if ( !versionArray[i].matches("[0-9]+") )
return false;
versionNumbers[i] = Integer.parseInt(versionArray[i]);
}
String[] borderArray = border.split("\\.");
int[] borderNumbers = new int[borderArray.length];
for ( int i=0; i<borderArray.length; i++ ) {
if ( !borderArray[i].matches("[0-9]+") )
return false;
borderNumbers[i] = Integer.parseInt(borderArray[i]);
}
int index = 0;
while ( (versionNumbers.length > index) && (borderNumbers.length > index) ) {
if ( versionNumbers[index] > borderNumbers[index] ) {
return true;
} else if ( versionNumbers[index] < borderNumbers[index] ) {
return false;
}
index++;
}
if ( borderNumbers.length == index ) {
return true;
} else {
return false;
}
}
/**
* 現在接続中のプレイヤーを全て取得する
* @return 接続中の全てのプレイヤー
*/
@SuppressWarnings("unchecked")
public static ArrayList<Player> getOnlinePlayers() {
// CB179以前と、CB1710以降で戻り値が異なるため、
// リフレクションを使って互換性を(無理やり)保つ。
try {
if (Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0]).getReturnType() == Collection.class) {
Collection<?> temp =
((Collection<?>) Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0])
.invoke(null, new Object[0]));
return new ArrayList<Player>((Collection<? extends Player>) temp);
} else {
Player[] temp =
((Player[]) Bukkit.class.getMethod("getOnlinePlayers", new Class<?>[0])
.invoke(null, new Object[0]));
ArrayList<Player> players = new ArrayList<Player>();
for (Player t : temp) {
players.add(t);
}
return players;
}
} catch (NoSuchMethodException ex) {} // never happen
catch (InvocationTargetException ex) {} // never happen
catch (IllegalAccessException ex) {} // never happen
return new ArrayList<Player>();
}
/**
* 現在のサーバー接続人数を返します。
* @return サーバー接続人数
*/
public static int getOnlinePlayersCount() {
return getOnlinePlayers().size();
}
/**
* 指定された名前のオフラインプレイヤーを取得する
* @param name プレイヤー名
* @return オフラインプレイヤー
*/
@SuppressWarnings("deprecation")
public static OfflinePlayer getOfflinePlayer(String name) {
if (name == null) return null;
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
if (player == null || (!player.hasPlayedBefore() && !player.isOnline()))
return null;
return player;
}
/**
* 指定された名前のプレイヤーを取得する
* @param name プレイヤー名
* @return プレイヤー
*/
public static Player getPlayerExact(String name) {
return Bukkit.getPlayer(stripColor(name));
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.bridge;
-63
ファイルの表示
@@ -1,63 +0,0 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2015
*/
package com.github.ucchyocean.lc.bridge;
import org.bukkit.Location;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.github.ucchyocean.lc.LunaChat;
import com.github.ucchyocean.lc.Utility;
import uk.co.oliwali.HawkEye.DataType;
import uk.co.oliwali.HawkEye.entry.DataEntry;
import uk.co.oliwali.HawkEye.util.HawkEyeAPI;
/**
* HawkEye連携クラス
* @author ucchy
*/
public class HawkEyeBridge {
private boolean isV162orLater;
/** コンストラクタは使用不可 */
private HawkEyeBridge() {
}
/**
* HawkEye Reloaded をロードする
* @param plugin HawkEye Reloaded のプラグインインスタンス
* @return ロードしたブリッジのインスタンス
*/
public static HawkEyeBridge load(Plugin plugin) {
String version = plugin.getDescription().getVersion();
HawkEyeBridge instance = new HawkEyeBridge();
instance.isV162orLater = Utility.isUpperVersion(version, "1.6.2");
return instance;
}
/**
* HawkEyeにCHATログを書き出す
* @param player プレイヤー名
* @param location 場所
* @param data データ
*/
@SuppressWarnings("deprecation")
public void writeLog(String player, Location location, String data) {
final DataEntry entry = new DataEntry(player, DataType.CHAT, location, data);
new BukkitRunnable() {
public void run() {
if ( isV162orLater ) {
HawkEyeAPI.addEntry(entry);
} else {
HawkEyeAPI.addEntry(LunaChat.getInstance(), entry);
}
}
}.runTaskAsynchronously(LunaChat.getInstance());
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2016
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.bridge;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2015
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.bridge;
-51
ファイルの表示
@@ -1,51 +0,0 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2016
*/
package com.github.ucchyocean.lc.bridge;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.github.ucchyocean.lc.LunaChat;
import me.botsko.prism.Prism;
import me.botsko.prism.actionlibs.ActionFactory;
import me.botsko.prism.actionlibs.RecordingQueue;
/**
* Prism連携クラス
* @author ucchy
*/
public class PrismBridge {
/** コンストラクタは使用不可 */
private PrismBridge() {
}
/**
* Prism をロードする
* @return ロードしたブリッジのインスタンス
*/
public static PrismBridge load() {
return new PrismBridge();
}
/**
* PrismにCHATログを書き出す
* @param player プレイヤー
* @param data データ
*/
public void writeLog(final Player player, final String data) {
if ( !Prism.getIgnore().event( "player-chat", player ) ) {
return;
}
new BukkitRunnable() {
public void run() {
RecordingQueue.addToQueue( ActionFactory.createPlayer(
"player-chat", player, data ) );
}
}.runTaskAsynchronously(LunaChat.getInstance());
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.bridge;
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
@@ -33,7 +33,7 @@ import com.github.ucchyocean.lc.japanize.JapanizeType;
* チャンネルの実装クラス
* @author ucchy
*/
public class ChannelImpl extends Channel {
public class BukkitChannel extends Channel {
private static final String PERMISSION_SPEAK_PREFIX = "lunachat.speak";
@@ -79,7 +79,7 @@ public class ChannelImpl extends Channel {
* コンストラクタ
* @param name チャンネル名
*/
protected ChannelImpl(String name) {
protected BukkitChannel(String name) {
super(name);
@@ -335,7 +335,7 @@ public class ChannelImpl extends Channel {
// 範囲チャット
Location origin = player.getPlayer().getLocation();
for ( Player p : Utility.getOnlinePlayers() ) {
for ( Player p : Bukkit.getOnlinePlayers() ) {
ChannelPlayer cp = ChannelPlayer.getChannelPlayer(p);
if ( p.getWorld().equals(w) &&
origin.distance(p.getLocation()) <= getChatRange() &&
@@ -347,7 +347,7 @@ public class ChannelImpl extends Channel {
} else {
// ワールドチャット
for ( Player p : Utility.getOnlinePlayers() ) {
for ( Player p : Bukkit.getOnlinePlayers() ) {
ChannelPlayer cp = ChannelPlayer.getChannelPlayer(p);
if ( p.getWorld().equals(w) && !getHided().contains(cp) ) {
recipients.add(ChannelPlayer.getChannelPlayer(p));
@@ -366,7 +366,7 @@ public class ChannelImpl extends Channel {
} else {
// 通常ブロードキャスト(全員へ送信)
for ( Player p : Utility.getOnlinePlayers() ) {
for ( Player p : Bukkit.getOnlinePlayers() ) {
ChannelPlayer cp = ChannelPlayer.getChannelPlayer(p);
if ( !getHided().contains(cp) ) {
recipients.add(cp);
@@ -388,7 +388,7 @@ public class ChannelImpl extends Channel {
// パーミッション lunachat-admin.listen-all-channels を持つプレイヤーを
// 受信者に加える。
if ( config.isOpListenAllChannel() ) {
for ( Player p : Utility.getOnlinePlayers() ) {
for ( Player p : Bukkit.getOnlinePlayers() ) {
ChannelPlayer cp = ChannelPlayer.getChannelPlayer(p);
if ( cp.hasPermission("lunachat-admin.listen-all-channels")
&& !recipients.contains(cp) ) {
@@ -757,19 +757,20 @@ public class ChannelImpl extends Channel {
logger.log(message, name);
}
// Hawkeye Reloaded のチャットログへ記録
if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null
&& player != null && player.getLocation() != null ) {
LunaChat.getInstance().getHawkEye().writeLog(name, player.getLocation(),
"channel(" + getName() + ")-" + Utility.stripColor(message));
}
// Prism のチャットログへ記録
if ( config.isLoggingChatToPrism() && LunaChat.getInstance().getPrism() != null
&& player != null && player.getPlayer() != null ) {
LunaChat.getInstance().getPrism().writeLog(player.getPlayer(),
"channel(" + getName() + ")-" + Utility.stripColor(message));
}
// TODO ログ記録プラグイン連携を検討する
// // Hawkeye Reloaded のチャットログへ記録
// if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null
// && player != null && player.getLocation() != null ) {
// LunaChat.getInstance().getHawkEye().writeLog(name, player.getLocation(),
// "channel(" + getName() + ")-" + Utility.stripColor(message));
// }
//
// // Prism のチャットログへ記録
// if ( config.isLoggingChatToPrism() && LunaChat.getInstance().getPrism() != null
// && player != null && player.getPlayer() != null ) {
// LunaChat.getInstance().getPrism().writeLog(player.getPlayer(),
// "channel(" + getName() + ")-" + Utility.stripColor(message));
// }
}
/**
+2 -32
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
@@ -471,7 +471,7 @@ public abstract class Channel implements ConfigurationSerializable {
return null;
}
Channel channel = new ChannelImpl(name);
Channel channel = new BukkitChannel(name);
channel.alias = castWithDefault(data.get(KEY_ALIAS), "");
channel.description = castWithDefault(data.get(KEY_DESC), "");
channel.format = castWithDefault(data.get(KEY_FORMAT), channel.format);
@@ -605,30 +605,6 @@ public abstract class Channel implements ConfigurationSerializable {
return (Map<String, Long>)obj;
}
/**
* チャンネルの設定ファイルが、UUID化のために一旦保存が必要かどうかを返す
* @param data チャンネルの実コンフィグデータ
*/
private static boolean isNeedToSaveForUUIDUpdate(Map<String, Object> data) {
if ( !Utility.isCB178orLater() ) {
return false;
}
List<String> members = castToStringList(data.get(KEY_MEMBERS));
if ( members.size() == 0 ) {
return false;
}
for ( String member : members ) {
if ( member.startsWith("$") ) {
return false;
}
}
return true;
}
/**
* チャンネルの別名を返す
* @return チャンネルの別名
@@ -974,12 +950,6 @@ public abstract class Channel implements ConfigurationSerializable {
data.put(key, config.get(key));
}
Channel channel = deserialize(data);
// 自動アップデート
if ( isNeedToSaveForUUIDUpdate(data) ) {
channel.save();
}
result.put(channel.name.toLowerCase(), channel);
}
+2 -2
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
@@ -447,7 +447,7 @@ public class ChannelManager implements LunaChatAPI {
}
String name = event.getChannelName();
Channel channel = new ChannelImpl(name);
Channel channel = new BukkitChannel(name);
channels.put(name.toLowerCase(), channel);
channel.save();
return channel;
+3 -14
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
@@ -11,8 +11,6 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import com.github.ucchyocean.lc.Utility;
/**
* プレイヤーの抽象クラス
* @author ucchy
@@ -136,14 +134,7 @@ public abstract class ChannelPlayer implements Comparable<ChannelPlayer> {
String id = nameOrUuid.substring(1);
return new ChannelPlayerUUID(id);
}
if ( Utility.isCB178orLater() ) {
ChannelPlayer player =
ChannelPlayerUUID.getChannelPlayerUUIDFromName(nameOrUuid);
if ( player != null ) {
return player;
}
}
return new ChannelPlayerName(nameOrUuid);
return ChannelPlayerUUID.getChannelPlayerUUIDFromName(nameOrUuid);
}
/**
@@ -158,9 +149,7 @@ public abstract class ChannelPlayer implements Comparable<ChannelPlayer> {
return new ChannelPlayerBlock((BlockCommandSender)sender);
} else if ( sender instanceof ConsoleCommandSender ) {
return new ChannelPlayerConsole((ConsoleCommandSender)sender);
} else if ( Utility.isCB178orLater() ) {
return ChannelPlayerUUID.getChannelPlayer(sender);
}
return new ChannelPlayerName(sender.getName());
return ChannelPlayerUUID.getChannelPlayer(sender);
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2015
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+2 -2
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
@@ -68,7 +68,7 @@ public class DelayedJapanizeConvertTask extends BukkitRunnable {
HashMap<String, String> keywordMap = new HashMap<String, String>();
ArrayList<String> keywords = new ArrayList<String>();
if ( LunaChat.getInstance().getLunaChatConfig().isJapanizeIgnorePlayerName() ) {
for ( Player player : Utility.getOnlinePlayers() ) {
for ( Player player : Bukkit.getOnlinePlayers() ) {
keywords.add(player.getName());
}
}
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2015
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2016
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.channel;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2014
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.command;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2015
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.event;
+4 -5
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.japanize;
@@ -14,7 +14,6 @@ import java.net.ProtocolException;
import java.net.URL;
import java.net.URLEncoder;
import com.github.ucchyocean.lc.Utility;
import com.google.common.io.CharStreams;
/**
@@ -80,9 +79,9 @@ public class IMEConverter {
String json = CharStreams.toString(reader);
String parsed = GoogleIME.parseJson(json);
if ( !Utility.isCB19orLater() ) {
parsed = YukiKanaConverter.fixBrackets(parsed);
}
// if ( !Utility.isCB19orLater() ) {
// parsed = YukiKanaConverter.fixBrackets(parsed);
// }
return parsed;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
/*
* @author ucchy
* @license LGPLv3
* @copyright Copyright ucchy 2013
* @copyright Copyright ucchy 2020
*/
package com.github.ucchyocean.lc.japanize;
+5 -5
ファイルの表示
@@ -40,9 +40,9 @@ public class YukiKanaConverter {
builder.put("who", "うぉ");
//
builder.put("wyi", "ゐ"); // +
builder.put("wyi", "ゐ");
//
builder.put("wye", "ゑ"); // +
builder.put("wye", "ゑ");
//
builder.put("la", "ぁ").put("xa", "ぁ");
@@ -52,7 +52,7 @@ public class YukiKanaConverter {
builder.put("lo", "ぉ").put("xo", "ぉ");
//
builder.put("ye", "いぇ"); // +
builder.put("ye", "いぇ");
//
//
//
@@ -79,7 +79,7 @@ public class YukiKanaConverter {
builder.put("qwi", "くぃ").put("qi", "くぃ").put("qyi", "くぃ");
builder.put("qwu", "くぅ");
builder.put("qwe", "くぇ").put("qe", "くぇ").put("qye", "くぇ");
builder.put("qwo", "くぉ").put("qo", "くぉ").put("kwo", "くぉ"); // +
builder.put("qwo", "くぉ").put("qo", "くぉ").put("kwo", "くぉ");
builder.put("ga", "が");
builder.put("gi", "ぎ");
@@ -191,7 +191,7 @@ public class YukiKanaConverter {
//
//
builder.put("ltu", "っ").put("xtu", "っ").put("ltsu", "っ").put("xtsu", "っ"); // +
builder.put("ltu", "っ").put("xtu", "っ").put("ltsu", "っ").put("xtsu", "っ");
//
//