LunaChat v3-k2 : Implement Backward Compatibility. (WIP)
このコミットが含まれているのは:
1 親
172e64aa50
コミット
7abc57f9ac
21ファイル変更
+267
-63
検索条件に一致するファイルはありません
@@ -12,6 +12,7 @@ package com.github.ucchyocean.lc;
|
||||
public class LunaChat {
|
||||
|
||||
private static LunaChat instance = new LunaChat();
|
||||
@SuppressWarnings("deprecation")
|
||||
private LunaChatAPI api = new LunaChatAPI();
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,16 +10,26 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.github.ucchyocean.lc.channel.Channel;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerBlock;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerConsole;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerName;
|
||||
import com.github.ucchyocean.lc.channel.ChannelPlayerUUID;
|
||||
import com.github.ucchyocean.lc.japanize.JapanizeType;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBlock;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBukkitConsole;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBungee;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberPlayer;
|
||||
|
||||
/**
|
||||
* LunaChat APIクラス
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatAPI {
|
||||
|
||||
@@ -27,6 +37,7 @@ public class LunaChatAPI {
|
||||
* 指定したチャンネル名が存在するかどうかを返す
|
||||
* @param channelName チャンネル名
|
||||
* @return 存在するかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isExistChannel(String channelName) {
|
||||
return com.github.ucchyocean.lc3.LunaChat.getAPI().isExistChannel(channelName);
|
||||
@@ -35,6 +46,7 @@ public class LunaChatAPI {
|
||||
/**
|
||||
* 全てのチャンネルを返す
|
||||
* @return 全てのチャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Collection<Channel> getChannels() {
|
||||
Collection<Channel> result = new ArrayList<Channel>();
|
||||
@@ -49,6 +61,7 @@ public class LunaChatAPI {
|
||||
* プレイヤーが参加しているチャンネルを返す
|
||||
* @param playerName プレイヤー名
|
||||
* @return チャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Collection<Channel> getChannelsByPlayer(String playerName) {
|
||||
Collection<Channel> result = new ArrayList<Channel>();
|
||||
@@ -63,6 +76,7 @@ public class LunaChatAPI {
|
||||
* プレイヤーが参加しているデフォルトのチャンネルを返す
|
||||
* @param playerName プレイヤー
|
||||
* @return チャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Channel getDefaultChannel(String playerName) {
|
||||
com.github.ucchyocean.lc3.channel.Channel c =
|
||||
@@ -75,6 +89,7 @@ public class LunaChatAPI {
|
||||
* プレイヤーのデフォルトチャンネルを設定する
|
||||
* @param playerName プレイヤー
|
||||
* @param channelName チャンネル名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setDefaultChannel(String playerName, String channelName) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().setDefaultChannel(playerName, channelName);
|
||||
@@ -83,6 +98,7 @@ public class LunaChatAPI {
|
||||
/**
|
||||
* 指定した名前のプレイヤーに設定されている、デフォルトチャンネルを削除する
|
||||
* @param playerName プレイヤー名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeDefaultChannel(String playerName) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().removeDefaultChannel(playerName);
|
||||
@@ -92,6 +108,7 @@ public class LunaChatAPI {
|
||||
* チャンネルを取得する
|
||||
* @param channelName チャンネル名
|
||||
* @return チャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Channel getChannel(String channelName) {
|
||||
com.github.ucchyocean.lc3.channel.Channel c =
|
||||
@@ -104,6 +121,7 @@ public class LunaChatAPI {
|
||||
* 新しいチャンネルを作成する
|
||||
* @param channelName チャンネル名
|
||||
* @return 作成されたチャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Channel createChannel(String channelName) {
|
||||
com.github.ucchyocean.lc3.channel.Channel c =
|
||||
@@ -117,6 +135,7 @@ public class LunaChatAPI {
|
||||
* @param channelName チャンネル名
|
||||
* @param sender チャンネルを作成した人
|
||||
* @return 作成されたチャンネル
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Channel createChannel(String channelName, CommandSender sender) {
|
||||
com.github.ucchyocean.lc3.channel.Channel c =
|
||||
@@ -130,6 +149,7 @@ public class LunaChatAPI {
|
||||
* チャンネルを削除する
|
||||
* @param channelName 削除するチャンネル名
|
||||
* @return 削除したかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean removeChannel(String channelName) {
|
||||
return com.github.ucchyocean.lc3.LunaChat.getAPI().removeChannel(channelName);
|
||||
@@ -140,6 +160,7 @@ public class LunaChatAPI {
|
||||
* @param channelName 削除するチャンネル名
|
||||
* @param sender チャンネルを削除した人
|
||||
* @return 削除したかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean removeChannel(String channelName, CommandSender sender) {
|
||||
return com.github.ucchyocean.lc3.LunaChat.getAPI().removeChannel(
|
||||
@@ -150,6 +171,7 @@ public class LunaChatAPI {
|
||||
* テンプレートを取得する
|
||||
* @param id テンプレートID
|
||||
* @return テンプレート
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getTemplate(String id) {
|
||||
return com.github.ucchyocean.lc3.LunaChat.getAPI().getTemplate(id);
|
||||
@@ -159,6 +181,7 @@ public class LunaChatAPI {
|
||||
* テンプレートを登録する
|
||||
* @param id テンプレートID
|
||||
* @param template テンプレート
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setTemplate(String id, String template) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().setTemplate(id, template);
|
||||
@@ -167,6 +190,7 @@ public class LunaChatAPI {
|
||||
/**
|
||||
* テンプレートを削除する
|
||||
* @param id テンプレートID
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeTemplate(String id) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().removeTemplate(id);
|
||||
@@ -175,6 +199,7 @@ public class LunaChatAPI {
|
||||
/**
|
||||
* 辞書データを全て取得する
|
||||
* @return 辞書データ
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public HashMap<String, String> getAllDictionary() {
|
||||
return new HashMap<String, String>(
|
||||
@@ -185,6 +210,7 @@ public class LunaChatAPI {
|
||||
* 新しい辞書データを追加する
|
||||
* @param key キー
|
||||
* @param value 値
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setDictionary(String key, String value) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().setDictionary(key, value);
|
||||
@@ -193,6 +219,7 @@ public class LunaChatAPI {
|
||||
/**
|
||||
* 指定したキーの辞書データを削除する
|
||||
* @param key キー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeDictionary(String key) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().removeDictionary(key);
|
||||
@@ -202,38 +229,60 @@ public class LunaChatAPI {
|
||||
* 該当のプレイヤーに関連するhidelistを取得する。
|
||||
* @param key プレイヤー
|
||||
* @return 指定されたプレイヤーをhideしているプレイヤー(非null)
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getHidelist(ChannelPlayer key) {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
List<ChannelPlayer> result = new ArrayList<ChannelPlayer>();
|
||||
ChannelMember mem = convertChannelPlayerToChannelMember(key);
|
||||
if ( mem == null ) return result;
|
||||
for ( ChannelMember m : com.github.ucchyocean.lc3.LunaChat.getAPI().getHidelist(mem) ) {
|
||||
ChannelPlayer p = convertChannelMemberToChannelPlayer(m);
|
||||
if ( p != null ) result.add(p);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 該当のプレイヤーがhideしているプレイヤーのリストを返す。
|
||||
* @param player プレイヤー
|
||||
* @return 指定したプレイヤーがhideしているプレイヤーのリスト
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public ArrayList<ChannelPlayer> getHideinfo(ChannelPlayer player) {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
ArrayList<ChannelPlayer> result = new ArrayList<ChannelPlayer>();
|
||||
ChannelMember mem = convertChannelPlayerToChannelMember(player);
|
||||
if ( mem == null ) return result;
|
||||
for ( ChannelMember m : com.github.ucchyocean.lc3.LunaChat.getAPI().getHideinfo(mem) ) {
|
||||
ChannelPlayer p = convertChannelMemberToChannelPlayer(m);
|
||||
if ( p != null ) result.add(p);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたプレイヤーが、指定されたプレイヤーをhideするように設定する。
|
||||
* @param player hideする側のプレイヤー
|
||||
* @param hided hideされる側のプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void addHidelist(ChannelPlayer player, ChannelPlayer hided) {
|
||||
// TODO 未実装
|
||||
ChannelMember memPlayer = convertChannelPlayerToChannelMember(player);
|
||||
ChannelMember memHided = convertChannelPlayerToChannelMember(hided);
|
||||
if ( memPlayer == null || memHided == null ) return;
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().addHidelist(memPlayer, memHided);
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定されたプレイヤーが、指定されたプレイヤーのhideを解除するように設定する。
|
||||
* @param player hideしていた側のプレイヤー
|
||||
* @param hided hideされていた側のプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeHidelist(ChannelPlayer player, ChannelPlayer hided) {
|
||||
// TODO 未実装
|
||||
ChannelMember memPlayer = convertChannelPlayerToChannelMember(player);
|
||||
ChannelMember memHided = convertChannelPlayerToChannelMember(hided);
|
||||
if ( memPlayer == null || memHided == null ) return;
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().removeHidelist(memPlayer, memHided);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,6 +290,7 @@ public class LunaChatAPI {
|
||||
* @param message 変換するメッセージ
|
||||
* @param type 変換タイプ
|
||||
* @return 変換後のメッセージ、ただしイベントでキャンセルされた場合はnullが返されるので注意
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String japanize(String message, JapanizeType type) {
|
||||
String value = (type != null) ? type.name() : "";
|
||||
@@ -254,6 +304,7 @@ public class LunaChatAPI {
|
||||
* 該当プレイヤーのJapanize変換をオン/オフする
|
||||
* @param playerName 設定するプレイヤー名
|
||||
* @param doJapanize Japanize変換するかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setPlayersJapanize(String playerName, boolean doJapanize) {
|
||||
com.github.ucchyocean.lc3.LunaChat.getAPI().setPlayersJapanize(playerName, doJapanize);
|
||||
@@ -263,8 +314,50 @@ public class LunaChatAPI {
|
||||
* プレイヤーのJapanize設定を返す
|
||||
* @param playerName プレイヤー名
|
||||
* @return Japanize設定
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isPlayerJapanize(String playerName) {
|
||||
return com.github.ucchyocean.lc3.LunaChat.getAPI().isPlayerJapanize(playerName);
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelPlayerをChannelMemberに変換する
|
||||
* @param cp
|
||||
* @return
|
||||
*/
|
||||
private ChannelMember convertChannelPlayerToChannelMember(ChannelPlayer cp) {
|
||||
if ( cp == null ) return null;
|
||||
if ( cp instanceof ChannelPlayerName || cp instanceof ChannelPlayerUUID ) {
|
||||
return ChannelMember.getChannelMember(cp.toString());
|
||||
} else if ( cp instanceof ChannelPlayerConsole ) {
|
||||
return new ChannelMemberBukkitConsole(Bukkit.getConsoleSender());
|
||||
} else if ( cp instanceof ChannelPlayerBlock ) {
|
||||
ChannelPlayerBlock cpb = (ChannelPlayerBlock)cp;
|
||||
if ( cpb.getBlockCommandSender() != null ) {
|
||||
return new ChannelMemberBlock(cpb.getBlockCommandSender());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelMemberをChannelPlayerに変換する
|
||||
* @param cp
|
||||
* @return
|
||||
*/
|
||||
private ChannelPlayer convertChannelMemberToChannelPlayer(ChannelMember cm) {
|
||||
if ( cm == null ) return null;
|
||||
if ( cm instanceof ChannelMemberBungee ) return null; // Bungeeモードの場合は変換できない
|
||||
if ( cm instanceof ChannelMemberPlayer ) {
|
||||
return ChannelPlayer.getChannelPlayer(cm.toString());
|
||||
} else if ( cm instanceof ChannelMemberBukkitConsole ) {
|
||||
return new ChannelPlayerConsole(Bukkit.getConsoleSender());
|
||||
} else if ( cm instanceof ChannelMemberBlock ) {
|
||||
ChannelMemberBlock cmb = (ChannelMemberBlock)cm;
|
||||
if ( cmb.getBlockCommandSender() != null ) {
|
||||
return new ChannelPlayerBlock(cmb.getBlockCommandSender());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,18 +6,24 @@
|
||||
package com.github.ucchyocean.lc.channel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.NotImplementedException;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.github.ucchyocean.lc.japanize.JapanizeType;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMember;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBlock;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBukkitConsole;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberBungee;
|
||||
import com.github.ucchyocean.lc3.member.ChannelMemberPlayer;
|
||||
|
||||
/**
|
||||
* チャンネル
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class Channel {
|
||||
|
||||
@@ -34,6 +40,7 @@ public class Channel {
|
||||
/**
|
||||
* 1:1チャットかどうか
|
||||
* @return 1:1チャットかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isPersonalChat() {
|
||||
return channel.isPersonalChat();
|
||||
@@ -42,6 +49,7 @@ public class Channel {
|
||||
/**
|
||||
* ブロードキャストチャンネルかどうか
|
||||
* @return ブロードキャストチャンネルかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isBroadcastChannel() {
|
||||
return channel.isBroadcastChannel();
|
||||
@@ -50,6 +58,7 @@ public class Channel {
|
||||
/**
|
||||
* グローバルチャンネルかどうか
|
||||
* @return グローバルチャンネルかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isGlobalChannel() {
|
||||
return channel.isGlobalChannel();
|
||||
@@ -58,6 +67,7 @@ public class Channel {
|
||||
/**
|
||||
* 強制参加チャンネルかどうか
|
||||
* @return 強制参加チャンネルかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isForceJoinChannel() {
|
||||
return channel.isForceJoinChannel();
|
||||
@@ -67,6 +77,7 @@ public class Channel {
|
||||
* このチャンネルのモデレータ権限を持っているかどうかを確認する
|
||||
* @param sender 権限を確認する対象
|
||||
* @return チャンネルのモデレータ権限を持っているかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean hasModeratorPermission(CommandSender sender) {
|
||||
return channel.hasModeratorPermission(ChannelMember.getChannelMember(sender));
|
||||
@@ -76,6 +87,7 @@ public class Channel {
|
||||
* このチャットに発言をする
|
||||
* @param player 発言をするプレイヤー
|
||||
* @param message 発言をするメッセージ
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void chat(ChannelPlayer player, String message) {
|
||||
// TODO player.getPlayer()で問題ないか、要確認
|
||||
@@ -87,6 +99,7 @@ public class Channel {
|
||||
* @param player プレイヤー名
|
||||
* @param source 連携元を判別する文字列
|
||||
* @param message メッセージ
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void chatFromOtherSource(String player, String source, String message) {
|
||||
channel.chatFromOtherSource(player, source, message);
|
||||
@@ -95,39 +108,52 @@ public class Channel {
|
||||
/**
|
||||
* メンバーを追加する
|
||||
* @param name 追加するプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void addMember(ChannelPlayer player) {
|
||||
throw new NotImplementedException("This is legacy method. Do not call!");
|
||||
if ( player != null ) {
|
||||
channel.addMember(ChannelMember.getChannelMember(player.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* メンバーを削除する
|
||||
* @param name 削除するプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeMember(ChannelPlayer player) {
|
||||
throw new NotImplementedException("This is legacy method. Do not call!");
|
||||
if ( player != null ) {
|
||||
channel.removeMember(ChannelMember.getChannelMember(player.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* モデレータを追加する
|
||||
* @param player 追加するプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void addModerator(ChannelPlayer player) {
|
||||
throw new NotImplementedException("This is legacy method. Do not call!");
|
||||
if ( player != null ) {
|
||||
channel.addModerator(ChannelMember.getChannelMember(player.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* モデレータを削除する
|
||||
* @param player 削除するプレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void removeModerator(ChannelPlayer player) {
|
||||
throw new NotImplementedException("This is legacy method. Do not call!");
|
||||
if ( player != null ) {
|
||||
channel.removeModerator(ChannelMember.getChannelMember(player.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* プレイヤーに関連する、システムメッセージをチャンネルに流す
|
||||
* @param key リソースキー
|
||||
* @param player プレイヤー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
protected void sendSystemMessage(String key, ChannelPlayer player) {
|
||||
// do nothing.
|
||||
@@ -140,16 +166,20 @@ public class Channel {
|
||||
* @param format フォーマット
|
||||
* @param sendDynmap dynmapへ送信するかどうか
|
||||
* @param displayName 発言者の表示名(APIに使用されます)
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void sendMessage(
|
||||
ChannelPlayer player, String message, String format, boolean sendDynmap, String displayName) {
|
||||
// do nothing.
|
||||
channel.sendMessage(
|
||||
ChannelMember.getChannelMember(player.toString()),
|
||||
message, format, sendDynmap, displayName);
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネル情報を返す
|
||||
* @param forModerator モデレータ向けの情報を含めるかどうか
|
||||
* @return チャンネル情報
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public ArrayList<String> getInfo(boolean forModerator) {
|
||||
return new ArrayList<String>(channel.getInfo(forModerator));
|
||||
@@ -162,6 +192,7 @@ public class Channel {
|
||||
* @param date 日付、今日のデータを取得するならnullを指定すること
|
||||
* @param reverse 逆順取得
|
||||
* @return ログデータ
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public ArrayList<String> getLog(
|
||||
String player, String filter, String date, boolean reverse) {
|
||||
@@ -171,6 +202,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのオンライン人数を返す
|
||||
* @return オンライン人数
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public int getOnlineNum() {
|
||||
return channel.getOnlineNum();
|
||||
@@ -179,6 +211,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの総参加人数を返す
|
||||
* @return 総参加人数
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public int getTotalNum() {
|
||||
return channel.getTotalNum();
|
||||
@@ -186,6 +219,7 @@ public class Channel {
|
||||
|
||||
/**
|
||||
* 期限付きBanや期限付きMuteをチェックし、期限が切れていたら解除を行う
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void checkExpires() {
|
||||
channel.checkExpires();
|
||||
@@ -194,6 +228,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの別名を返す
|
||||
* @return チャンネルの別名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getAlias() {
|
||||
return channel.getAlias();
|
||||
@@ -202,6 +237,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの別名を設定する
|
||||
* @param alias チャンネルの別名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setAlias(String alias) {
|
||||
channel.setAlias(alias);
|
||||
@@ -210,6 +246,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの説明文を返す
|
||||
* @return チャンネルの説明文
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getDescription() {
|
||||
return channel.getDescription();
|
||||
@@ -218,6 +255,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの説明文を設定する
|
||||
* @param description チャンネルの説明文
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
channel.setDescription(description);
|
||||
@@ -226,6 +264,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのパスワードを返す
|
||||
* @return チャンネルのパスワード
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getPassword() {
|
||||
return channel.getPassword();
|
||||
@@ -234,6 +273,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのパスワードを設定する
|
||||
* @param password チャンネルのパスワード
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
channel.setPassword(password);
|
||||
@@ -242,6 +282,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの可視性を返す
|
||||
* @return チャンネルの可視性
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isVisible() {
|
||||
return channel.isVisible();
|
||||
@@ -250,6 +291,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルの可視性を設定する
|
||||
* @param visible チャンネルの可視性
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setVisible(boolean visible) {
|
||||
channel.setVisible(visible);
|
||||
@@ -258,6 +300,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのメッセージフォーマットを返す
|
||||
* @return チャンネルのメッセージフォーマット
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getFormat() {
|
||||
return channel.getFormat();
|
||||
@@ -266,6 +309,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのメッセージフォーマットを設定する
|
||||
* @param format チャンネルのメッセージフォーマット
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
channel.setFormat(format);
|
||||
@@ -274,74 +318,70 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのメンバーを返す
|
||||
* @return チャンネルのメンバー
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getMembers() {
|
||||
List<ChannelPlayer> result = new ArrayList<ChannelPlayer>();
|
||||
|
||||
for ( ChannelMember member : channel.getMembers() ) {
|
||||
// TODO 未実装
|
||||
}
|
||||
|
||||
return result;
|
||||
return convertMemberListToPlayerList(channel.getMembers());
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルのモデレーターを返す
|
||||
* @return チャンネルのモデレーター
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getModerator() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getModerator());
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルのBANリストを返す
|
||||
* @return チャンネルのBANリスト
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getBanned() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getBanned());
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルのMuteリストを返す
|
||||
* @return チャンネルのMuteリスト
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getMuted() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getMuted());
|
||||
}
|
||||
|
||||
/**
|
||||
* 期限付きBANの期限マップを返す(key=プレイヤー名、value=期日(ミリ秒))
|
||||
* @return banExpires
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Map<ChannelPlayer, Long> getBanExpires() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getBanExpires());
|
||||
}
|
||||
|
||||
/**
|
||||
* 期限付きMuteの期限マップを返す(key=プレイヤー名、value=期日(ミリ秒))
|
||||
* @return muteExpires
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public Map<ChannelPlayer, Long> getMuteExpires() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getMuteExpires());
|
||||
}
|
||||
|
||||
/**
|
||||
* 非表示プレイヤーの一覧を返す
|
||||
* @return チャンネルの非表示プレイヤーの一覧
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public List<ChannelPlayer> getHided() {
|
||||
// TODO 未実装
|
||||
return null;
|
||||
return convertMemberListToPlayerList(channel.getHided());
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネル名を返す
|
||||
* @return チャンネル名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getName() {
|
||||
return channel.getName();
|
||||
@@ -350,6 +390,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのカラーコードを返す
|
||||
* @return チャンネルのカラーコード
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getColorCode() {
|
||||
return channel.getColorCode();
|
||||
@@ -358,6 +399,7 @@ public class Channel {
|
||||
/**
|
||||
* チャンネルのカラーコードを設定する
|
||||
* @param colorCode カラーコード
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setColorCode(String colorCode) {
|
||||
channel.setColorCode(colorCode);
|
||||
@@ -366,6 +408,7 @@ public class Channel {
|
||||
/**
|
||||
* ブロードキャストチャンネルを設定する
|
||||
* @param broadcast ブロードキャストチャンネルにするかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setBroadcast(boolean broadcast) {
|
||||
channel.setBroadcast(broadcast);
|
||||
@@ -374,6 +417,7 @@ public class Channel {
|
||||
/**
|
||||
* チャットを同ワールド内に制限するかどうかを設定する
|
||||
* @param isWorldRange 同ワールド制限するかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setWorldRange(boolean isWorldRange) {
|
||||
channel.setWorldRange(isWorldRange);
|
||||
@@ -382,6 +426,7 @@ public class Channel {
|
||||
/**
|
||||
* チャットの可聴範囲を設定する
|
||||
* @param range 可聴範囲
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setChatRange(int range) {
|
||||
channel.setChatRange(range);
|
||||
@@ -390,6 +435,7 @@ public class Channel {
|
||||
/**
|
||||
* 1:1チャットのときに、会話の相手先を取得する
|
||||
* @return 会話の相手のプレイヤー名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public String getPrivateMessageTo() {
|
||||
if ( channel.getPrivateMessageTo() != null ) return channel.getPrivateMessageTo().getName();
|
||||
@@ -399,6 +445,7 @@ public class Channel {
|
||||
/**
|
||||
* 1:1チャットのときに、会話の相手先を設定する
|
||||
* @param name 会話の相手のプレイヤー名
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setPrivateMessageTo(String name) {
|
||||
channel.setPrivateMessageTo(ChannelMember.getChannelMember(name));
|
||||
@@ -407,6 +454,7 @@ public class Channel {
|
||||
/**
|
||||
* ワールドチャットかどうか
|
||||
* @return ワールドチャットかどうか
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isWorldRange() {
|
||||
return channel.isWorldRange();
|
||||
@@ -415,6 +463,7 @@ public class Channel {
|
||||
/**
|
||||
* チャットの可聴範囲、0の場合は無制限
|
||||
* @return チャットの可聴範囲
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public int getChatRange() {
|
||||
return channel.getChatRange();
|
||||
@@ -423,6 +472,7 @@ public class Channel {
|
||||
/**
|
||||
* カラーコードが使用可能な設定かどうか
|
||||
* @return allowccを返す
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean isAllowCC() {
|
||||
return channel.isAllowCC();
|
||||
@@ -431,6 +481,7 @@ public class Channel {
|
||||
/**
|
||||
* カラーコードの使用可否を設定する
|
||||
* @param allowcc 使用可否
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setAllowCC(boolean allowcc) {
|
||||
channel.setAllowCC(allowcc);
|
||||
@@ -439,6 +490,7 @@ public class Channel {
|
||||
/**
|
||||
* Japanize変換設定を取得する
|
||||
* @return japanize
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public JapanizeType getJapanizeType() {
|
||||
String value = (channel.getJapanizeType() != null) ? channel.getJapanizeType().name() : "";
|
||||
@@ -448,16 +500,68 @@ public class Channel {
|
||||
/**
|
||||
* Japanize変換設定を再設定する
|
||||
* @param japanize japanize
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public void setJapanizeType(JapanizeType japanize) {
|
||||
// do nothing.
|
||||
channel.setJapanizeType(com.github.ucchyocean.lc3.japanize.JapanizeType.fromID(
|
||||
japanize.name(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルの情報をファイルに保存する。
|
||||
* @return 保存をしたかどうか。
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public boolean save() {
|
||||
return channel.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelMemberをChannelPlayerに変換する
|
||||
* @param cp
|
||||
* @return
|
||||
*/
|
||||
private ChannelPlayer convertChannelMemberToChannelPlayer(ChannelMember cm) {
|
||||
if ( cm == null ) return null;
|
||||
if ( cm instanceof ChannelMemberBungee ) return null; // Bungeeモードの場合は変換できない
|
||||
if ( cm instanceof ChannelMemberPlayer ) {
|
||||
return ChannelPlayer.getChannelPlayer(cm.toString());
|
||||
} else if ( cm instanceof ChannelMemberBukkitConsole ) {
|
||||
return new ChannelPlayerConsole(Bukkit.getConsoleSender());
|
||||
} else if ( cm instanceof ChannelMemberBlock ) {
|
||||
ChannelMemberBlock cmb = (ChannelMemberBlock)cm;
|
||||
if ( cmb.getBlockCommandSender() != null ) {
|
||||
return new ChannelPlayerBlock(cmb.getBlockCommandSender());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelMemberのリストをChannelPlayerのリストに変換する
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
private List<ChannelPlayer> convertMemberListToPlayerList(List<ChannelMember> list) {
|
||||
List<ChannelPlayer> result = new ArrayList<ChannelPlayer>();
|
||||
for ( ChannelMember member : list ) {
|
||||
ChannelPlayer player = convertChannelMemberToChannelPlayer(member);
|
||||
if ( player != null ) result.add(player);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* ChannelMemberのマップをChannelPlayerのリストに変換する
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
private Map<ChannelPlayer, Long> convertMemberListToPlayerList(Map<ChannelMember, Long> map) {
|
||||
Map<ChannelPlayer, Long> result = new HashMap<ChannelPlayer, Long>();
|
||||
for ( ChannelMember member : map.keySet() ) {
|
||||
ChannelPlayer player = convertChannelMemberToChannelPlayer(member);
|
||||
if ( player != null ) result.put(player, map.get(member));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* プレイヤーの抽象クラス
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public abstract class ChannelPlayer implements Comparable<ChannelPlayer> {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* コマンドブロック
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class ChannelPlayerBlock extends ChannelPlayer {
|
||||
|
||||
@@ -161,4 +162,8 @@ public class ChannelPlayerBlock extends ChannelPlayer {
|
||||
public String toString() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
public BlockCommandSender getBlockCommandSender() {
|
||||
return sender;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* コンソール
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class ChannelPlayerConsole extends ChannelPlayer {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* 名前管理のプレイヤー
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class ChannelPlayerName extends ChannelPlayer {
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* UUID管理のプレイヤー
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class ChannelPlayerUUID extends ChannelPlayer {
|
||||
|
||||
@@ -47,7 +48,6 @@ public class ChannelPlayerUUID extends ChannelPlayer {
|
||||
if ( player != null ) {
|
||||
return new ChannelPlayerUUID(player.getUniqueId());
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer offline = Bukkit.getOfflinePlayer(name);
|
||||
if ( offline != null && offline.getUniqueId() != null ) {
|
||||
return new ChannelPlayerUUID(offline.getUniqueId());
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.event.Cancellable;
|
||||
/**
|
||||
* 基底のキャンセル可能イベントクラス
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatBaseCancellableEvent extends LunaChatBaseEvent implements Cancellable {
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.github.ucchyocean.lc.channel.Channel;
|
||||
/**
|
||||
* 基底イベントクラス
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public abstract class LunaChatBaseEvent extends Event {
|
||||
|
||||
@@ -51,7 +52,6 @@ public abstract class LunaChatBaseEvent extends Event {
|
||||
* チャンネルを取得する
|
||||
* @return チャンネル
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public Channel getChannel() {
|
||||
return LunaChat.getInstance().getLunaChatAPI().getChannel(channelName);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
/**
|
||||
* チャンネルチャットのチャットイベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelChatEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.github.ucchyocean.lc.channel.Channel;
|
||||
/**
|
||||
* チャンネル作成イベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelCreateEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
/**
|
||||
* メンバー変更イベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelMemberChangedEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
* チャンネルチャットのメッセージイベント、
|
||||
* このイベントはキャンセルできない。
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelMessageEvent extends LunaChatBaseEvent {
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
/**
|
||||
* オプション変更イベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelOptionChangedEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.bukkit.command.CommandSender;
|
||||
/**
|
||||
* チャンネル削除イベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatChannelRemoveEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
/**
|
||||
* Japanize変換が行われた後に呼び出されるイベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatPostJapanizeEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.github.ucchyocean.lc.channel.ChannelPlayer;
|
||||
/**
|
||||
* チャンネルチャットへの発言前に発生するイベント
|
||||
* @author ucchy
|
||||
* @deprecated Legacy Version
|
||||
*/
|
||||
public class LunaChatPreChatEvent extends LunaChatBaseCancellableEvent {
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
package com.github.ucchyocean.lc3;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -148,7 +147,7 @@ public interface LunaChatAPI {
|
||||
* @param player プレイヤー
|
||||
* @return 指定したプレイヤーがhideしているプレイヤーのリスト
|
||||
*/
|
||||
public ArrayList<ChannelMember> getHideinfo(ChannelMember player);
|
||||
public List<ChannelMember> getHideinfo(ChannelMember player);
|
||||
|
||||
/**
|
||||
* 指定されたプレイヤーが、指定されたプレイヤーをhideするように設定する。
|
||||
|
||||
@@ -7,8 +7,6 @@ package com.github.ucchyocean.lc3;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -18,8 +16,10 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public class UUIDCacheData {
|
||||
|
||||
// キャッシュデータ key=UUID文字列、value=プレイヤー名
|
||||
private Map<String, String> caches;
|
||||
private static final String FILE_NAME = "uuidcache.yml";
|
||||
|
||||
// キャッシュデータ key=UUID文字列、value=プレイヤー名
|
||||
private YamlConfig cache;
|
||||
|
||||
private File dataFolder;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class UUIDCacheData {
|
||||
* @param dataFolder プラグインのデータ格納フォルダ
|
||||
*/
|
||||
public UUIDCacheData(File dataFolder) {
|
||||
caches = new HashMap<String, String>();
|
||||
cache = new YamlConfig();
|
||||
this.dataFolder = dataFolder;
|
||||
reload();
|
||||
}
|
||||
@@ -37,41 +37,27 @@ public class UUIDCacheData {
|
||||
* キャッシュデータを読み込む
|
||||
*/
|
||||
public void reload() {
|
||||
|
||||
caches.clear();
|
||||
|
||||
File file = new File(dataFolder, "uuidcache.yml");
|
||||
File file = new File(dataFolder, FILE_NAME);
|
||||
if ( !file.exists() ) {
|
||||
// キャッシュファイルがまだ無いなら、からファイルを作成しておく。
|
||||
YamlConfig yaml = new YamlConfig();
|
||||
cache = new YamlConfig();
|
||||
try {
|
||||
yaml.save(file);
|
||||
cache.save(file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
YamlConfig yaml = YamlConfig.load(file);
|
||||
|
||||
for ( String uuid : yaml.getKeys(false) ) {
|
||||
caches.put(uuid, yaml.getString(uuid));
|
||||
}
|
||||
cache = YamlConfig.load(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* キャッシュデータをファイルに保存する
|
||||
*/
|
||||
public void save() {
|
||||
|
||||
YamlConfig yaml = new YamlConfig();
|
||||
for ( String uuid : caches.keySet() ) {
|
||||
yaml.set(uuid, caches.get(uuid));
|
||||
}
|
||||
|
||||
File file = new File(dataFolder, "uuidcache.yml");
|
||||
File file = new File(dataFolder, FILE_NAME);
|
||||
try {
|
||||
yaml.save(file);
|
||||
cache.save(file);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -83,7 +69,7 @@ public class UUIDCacheData {
|
||||
* @param name プレイヤー名
|
||||
*/
|
||||
public void put(String uuid, String name) {
|
||||
caches.put(uuid, name);
|
||||
cache.set(uuid, name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,6 +78,6 @@ public class UUIDCacheData {
|
||||
* @return プレイヤー名(キャッシュされていない場合はnullが返される)
|
||||
*/
|
||||
public @Nullable String get(String uuid) {
|
||||
return caches.get(uuid);
|
||||
return cache.getString(uuid);
|
||||
}
|
||||
}
|
||||
@@ -165,4 +165,8 @@ public class ChannelMemberBlock extends ChannelMemberBukkit {
|
||||
public World getWorld() {
|
||||
return sender.getBlock().getWorld();
|
||||
}
|
||||
|
||||
public BlockCommandSender getBlockCommandSender() {
|
||||
return sender;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする