diff --git a/lib/HawkEye.jar b/lib/HawkEye.jar deleted file mode 100644 index 197a4e9..0000000 Binary files a/lib/HawkEye.jar and /dev/null differ diff --git a/pom.xml b/pom.xml index 78a8e91..5fc1642 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.github.ucchyocean LunaChat - 2.8.2 + 2.8.3 チャンネルチャットプラグイン @@ -101,28 +101,33 @@ Multiverse repository http://repo.onarandombox.com/content/groups/public - - drtshock-releases - mcMMO repository - https://ci.drtshock.net/plugin/repository/everything - spigot-repo Spigot Maven Repository https://hub.spigotmc.org/nexus/content/groups/public + + minebuilders-repo + HawkEye Reloaded repository + http://minebuilders.me:8080/plugin/repository/everything + + + md5-repo + MD5 repository + http://repo.md-5.net/content/repositories/releases + org.bukkit bukkit - 1.9-R0.1-SNAPSHOT + 1.9.4-R0.1-SNAPSHOT net.milkbowl.vault VaultAPI - 1.5 + 1.6 org.dynmap @@ -132,9 +137,7 @@ uk.co.oliwali HawkEye - 1.7.1-DEV - system - ${basedir}/lib/HawkEye.jar + 1.7.2 com.onarandombox.multiversecore @@ -144,7 +147,7 @@ com.gmail.nossr50.mcMMO mcMMO - 1.5.04-SNAPSHOT + 1.5.00 \ No newline at end of file diff --git a/src/main/java/com/github/ucchyocean/lc/LunaChat.java b/src/main/java/com/github/ucchyocean/lc/LunaChat.java index cef2694..05475c0 100644 --- a/src/main/java/com/github/ucchyocean/lc/LunaChat.java +++ b/src/main/java/com/github/ucchyocean/lc/LunaChat.java @@ -82,8 +82,9 @@ public class LunaChat extends JavaPlugin { } // HawkEye のロード - if ( getServer().getPluginManager().isPluginEnabled("HawkEye") ) { - hawkeye = new HawkEyeBridge(); + temp = getServer().getPluginManager().getPlugin("HawkEye"); + if ( temp != null ) { + hawkeye = HawkEyeBridge.load(temp); } // MultiverseCore のロード diff --git a/src/main/java/com/github/ucchyocean/lc/Utility.java b/src/main/java/com/github/ucchyocean/lc/Utility.java index 9387117..2454caf 100644 --- a/src/main/java/com/github/ucchyocean/lc/Utility.java +++ b/src/main/java/com/github/ucchyocean/lc/Utility.java @@ -240,7 +240,7 @@ public class Utility { * ただし、無効なバージョン番号(数値でないなど)が指定された場合はfalseに、 * 2つのバージョンが完全一致した場合はtrueになる。 */ - private static boolean isUpperVersion(String version, String border) { + public static boolean isUpperVersion(String version, String border) { int hyphen = version.indexOf("-"); if ( hyphen > 0 ) { diff --git a/src/main/java/com/github/ucchyocean/lc/bridge/HawkEyeBridge.java b/src/main/java/com/github/ucchyocean/lc/bridge/HawkEyeBridge.java index 8298c7e..d0b3dd4 100644 --- a/src/main/java/com/github/ucchyocean/lc/bridge/HawkEyeBridge.java +++ b/src/main/java/com/github/ucchyocean/lc/bridge/HawkEyeBridge.java @@ -6,7 +6,10 @@ package com.github.ucchyocean.lc.bridge; import org.bukkit.Location; -import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; + +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; @@ -18,25 +21,38 @@ import uk.co.oliwali.HawkEye.util.HawkEyeAPI; */ public class HawkEyeBridge { + private boolean isV162orLater; + + /** コンストラクタは使用不可 */ + private HawkEyeBridge() { + } + /** - * HawkEyeにCHATログを書き出す - * @param action アクション - * @param player プレイヤー - * @param location 場所 - * @param data データ + * HawkEye Reloaded をロードする + * @param plugin HawkEye Reloaded のプラグインインスタンス + * @return ロードしたブリッジのインスタンス */ - public void writeLog(String action, Player player, Location location, String data) { - HawkEyeAPI.addEntry(new DataEntry(player, DataType.CHAT, location, data)); + 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 action アクション * @param player プレイヤー名 * @param location 場所 * @param data データ */ - public void writeLog(String action, String player, Location location, String data) { - HawkEyeAPI.addEntry(new DataEntry(player, DataType.CHAT, location, data)); + @SuppressWarnings("deprecation") + public void writeLog(String player, Location location, String data) { + DataEntry entry = new DataEntry(player, DataType.CHAT, location, data); + if ( isV162orLater ) { + HawkEyeAPI.addEntry(entry); + } else { + HawkEyeAPI.addEntry(LunaChat.getInstance(), entry); + } } } diff --git a/src/main/java/com/github/ucchyocean/lc/bridge/VaultChatBridge.java b/src/main/java/com/github/ucchyocean/lc/bridge/VaultChatBridge.java index dd00dc7..67e3260 100644 --- a/src/main/java/com/github/ucchyocean/lc/bridge/VaultChatBridge.java +++ b/src/main/java/com/github/ucchyocean/lc/bridge/VaultChatBridge.java @@ -5,13 +5,13 @@ */ package com.github.ucchyocean.lc.bridge; -import net.milkbowl.vault.chat.Chat; - import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.RegisteredServiceProvider; +import net.milkbowl.vault.chat.Chat; + /** * Vault-Chat連携クラス * @author ucchy @@ -28,7 +28,7 @@ public class VaultChatBridge { /** * vault-chatをロードする * @param plugin vaultのプラグインインスタンス - * @param ロードしたかどうか + * @return ロードしたブリッジのインスタンス */ public static VaultChatBridge load(Plugin plugin) { diff --git a/src/main/java/com/github/ucchyocean/lc/channel/ChannelImpl.java b/src/main/java/com/github/ucchyocean/lc/channel/ChannelImpl.java index 348105e..81676a1 100644 --- a/src/main/java/com/github/ucchyocean/lc/channel/ChannelImpl.java +++ b/src/main/java/com/github/ucchyocean/lc/channel/ChannelImpl.java @@ -756,8 +756,8 @@ public class ChannelImpl extends Channel { } if ( config.isLoggingChatToHawkEye() && LunaChat.getInstance().getHawkEye() != null && player != null && player.getLocation() != null ) { - LunaChat.getInstance().getHawkEye().writeLog("channel(" + getName() + ")", name, - player.getLocation(), Utility.stripColor(message)); + LunaChat.getInstance().getHawkEye().writeLog(name, player.getLocation(), + "channel(" + getName() + ")-" + Utility.stripColor(message)); } } diff --git a/src/main/resources/config_ja.yml b/src/main/resources/config_ja.yml index 5e12761..b59e238 100644 --- a/src/main/resources/config_ja.yml +++ b/src/main/resources/config_ja.yml @@ -26,7 +26,7 @@ noJoinAsGlobal: true loggingChat: true # チャンネルチャットの発言内容を、HawkEyeに記録するかどうか -# この設定を利用する場合は、HawkEyeのconfig.ymlで、log: セクションの other の設定を true にしてください。 +# この設定を利用する場合は、HawkEyeのconfig.ymlで、log: セクションの chat の設定を true にしてください。 loggingChatToHawkEye: true # チャンネルチャットの発言内容を、サーバーコンソールに表示するかどうか