diff --git a/lib/HeroTitles.jar b/lib/HeroTitles.jar new file mode 100644 index 0000000..1a6ba6c Binary files /dev/null and b/lib/HeroTitles.jar differ diff --git a/pom.xml b/pom.xml index 415d119..2ce396d 100644 --- a/pom.xml +++ b/pom.xml @@ -151,6 +151,13 @@ PermissionsEx 1.18 + + com.herocraftonline.HeroTitles + HeroTitles + system + 0.0.1 + ${project.basedir}/lib/HeroTitles.jar + diff --git a/src/net/milkbowl/vault/Vault.java b/src/net/milkbowl/vault/Vault.java index 4d75b5d..287144c 100644 --- a/src/net/milkbowl/vault/Vault.java +++ b/src/net/milkbowl/vault/Vault.java @@ -27,6 +27,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import net.milkbowl.vault.chat.Chat; import net.milkbowl.vault.chat.plugins.Chat_GroupManager; +import net.milkbowl.vault.chat.plugins.Chat_HeroTitles; import net.milkbowl.vault.chat.plugins.Chat_Permissions3; import net.milkbowl.vault.chat.plugins.Chat_PermissionsEx; import net.milkbowl.vault.chat.plugins.Chat_Towny; @@ -65,6 +66,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerListener; import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.ServicePriority; +import org.bukkit.plugin.ServicesManager; import org.bukkit.plugin.java.JavaPlugin; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -77,6 +79,7 @@ public class Vault extends JavaPlugin { private Permission perms; private String newVersion; private String currentVersion; + private ServicesManager sm; @Override public void onDisable() { @@ -89,6 +92,7 @@ public class Vault extends JavaPlugin { @Override public void onEnable() { currentVersion = getDescription().getVersion().substring(0, 5); + sm = getServer().getServicesManager(); // Load Vault Addons loadEconomy(); loadPermission(); @@ -129,51 +133,57 @@ public class Vault extends JavaPlugin { // Try to load PermissionsEx if (packageExists(new String[] { "ru.tehkode.permissions.bukkit.PermissionsEx" })) { Chat eChat = new Chat_PermissionsEx(this, perms); - getServer().getServicesManager().register(Chat.class, eChat, this, ServicePriority.Highest); + sm.register(Chat.class, eChat, this, ServicePriority.High); log.info(String.format("[%s][Chat] PermissionsEx found: %s", getDescription().getName(), eChat.isEnabled() ? "Loaded" : "Waiting")); } //Try loading mChat if (packageExists(new String[] {"net.D3GN.MiracleM4n.mChat"} )) { Chat mChat = new Chat_mChat(this, perms); - getServer().getServicesManager().register(Chat.class, mChat, this, ServicePriority.Highest); + sm.register(Chat.class, mChat, this, ServicePriority.High); log.info(String.format("[%s][Chat] mChat found: %s", getDescription().getName(), mChat.isEnabled() ? "Loaded" : "Waiting")); } //try loading bPermissions if (packageExists(new String[] {"de.bananaco.permissions.worlds.WorldPermissionsManager"})) { Chat bPerms = new Chat_bPermissions(this, perms); - getServer().getServicesManager().register(Chat.class, bPerms, this, ServicePriority.High); + sm.register(Chat.class, bPerms, this, ServicePriority.Normal); log.info(String.format("[%s][Chat] bPermissions found: %s", getDescription().getName(), bPerms.isEnabled() ? "Loaded" : "Waiting")); } // Try to load GroupManager if (packageExists(new String[] { "org.anjocaido.groupmanager.GroupManager" })) { Chat gPerms = new Chat_GroupManager(this, perms); - getServer().getServicesManager().register(Chat.class, gPerms, this, ServicePriority.High); + sm.register(Chat.class, gPerms, this, ServicePriority.Normal); log.info(String.format("[%s][Chat] GroupManager found: %s", getDescription().getName(), gPerms.isEnabled() ? "Loaded" : "Waiting")); } // Try to load Permissions 3 (Yeti) if (packageExists(new String[] { "com.nijiko.permissions.ModularControl" })) { Chat nPerms = new Chat_Permissions3(this, perms); - getServer().getServicesManager().register(Chat.class, nPerms, this, ServicePriority.High); + sm.register(Chat.class, nPerms, this, ServicePriority.Normal); log.info(String.format("[%s][Chat] Permissions 3 (Yeti) found: %s", getDescription().getName(), nPerms.isEnabled() ? "Loaded" : "Waiting")); } // Try to load iChat if (packageExists(new String[] { "net.TheDgtl.iChat.iChat" })) { Chat iChat = new Chat_iChat(this, perms); - getServer().getServicesManager().register(Chat.class, iChat, this, ServicePriority.Low); + sm.register(Chat.class, iChat, this, ServicePriority.Low); log.info(String.format("[%s][Chat] iChat found: %s", getDescription().getName(), iChat.isEnabled() ? "Loaded" : "Waiting")); } //Try to load Towny Chat if (packageExists(new String[] {"com.palmergames.bukkit.towny;"})) { Chat townChat = new Chat_Towny(this, perms); - getServer().getServicesManager().register(Chat.class, townChat, this, ServicePriority.Lowest); + sm.register(Chat.class, townChat, this, ServicePriority.Lowest); log.info(String.format("[%s][Chat] Towny found: %s", getDescription().getName(), townChat.isEnabled() ? "Loaded" : "Waiting")); } + + if (packageExists(new String[] {"com.herocraftonline.herotitles"} )) { + Chat htChat = new Chat_HeroTitles(this, perms, sm.getRegistration(Chat.class).getProvider()); + sm.register(Chat.class, htChat, this, ServicePriority.Highest); + log.info(String.format("[%s][Chat] HeroTitles found: %s", getDescription().getName(), htChat.isEnabled() ? "Loaded" : "Waiting")); + } } /** @@ -183,14 +193,14 @@ public class Vault extends JavaPlugin { // Try to load MultiCurrency if (packageExists(new String[] { "me.ashtheking.currency.Currency", "me.ashtheking.currency.CurrencyList" })) { Economy econ = new Economy_MultiCurrency(this); - getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + sm.register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] MultiCurrency found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } //Try Loading MineConomy if (packageExists(new String[] { "me.mjolnir.mineconomy.MineConomy" })) { Economy econ = new Economy_MineConomy(this); - getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + sm.register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] MineConomy found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } @@ -198,70 +208,70 @@ public class Vault extends JavaPlugin { //Try loading eWallet if (packageExists(new String[] { "me.ethan.eWallet.ECO" })) { Economy econ = new Economy_eWallet(this); - getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + sm.register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] eWallet found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } // Try to load 3co if (packageExists(new String[] { "me.ic3d.eco.ECO" })) { Economy econ = new Economy_3co(this); - getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + sm.register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] 3co found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } // Try to load BOSEconomy if (packageExists(new String[] { "cosine.boseconomy.BOSEconomy", "cosine.boseconomy.CommandManager" })) { Economy bose6 = new Economy_BOSE6(this); - getServer().getServicesManager().register(Economy.class, bose6, this, ServicePriority.Normal); + sm.register(Economy.class, bose6, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] BOSEconomy6 found: %s", getDescription().getName(), bose6.isEnabled() ? "Loaded" : "Waiting")); } // Try to load BOSEconomy if (packageExists(new String[] { "cosine.boseconomy.BOSEconomy", "cosine.boseconomy.CommandHandler" })) { Economy bose7 = new Economy_BOSE7(this); - getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, bose7, this, ServicePriority.Normal); + sm.register(net.milkbowl.vault.economy.Economy.class, bose7, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] BOSEconomy7 found: %s", getDescription().getName(), bose7.isEnabled() ? "Loaded" : "Waiting")); } //Try to load CurrencyCore if (packageExists(new String[] { "is.currency.Currency" })) { Economy cCore = new Economy_CurrencyCore(this); - getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, cCore, this, ServicePriority.Normal); + sm.register(net.milkbowl.vault.economy.Economy.class, cCore, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] CurrencyCore found: %s", getDescription().getName(), cCore.isEnabled() ? "Loaded" : "Waiting")); } // Try to load Essentials Economy if (packageExists(new String[] { "com.earth2me.essentials.api.Economy", "com.earth2me.essentials.api.NoLoanPermittedException", "com.earth2me.essentials.api.UserDoesNotExistException" })) { Economy essentials = new Economy_Essentials(this); - getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, essentials, this, ServicePriority.Low); + sm.register(net.milkbowl.vault.economy.Economy.class, essentials, this, ServicePriority.Low); log.info(String.format("[%s][Economy] Essentials Economy found: %s", getDescription().getName(), essentials.isEnabled() ? "Loaded" : "Waiting")); } // Try to load iConomy 4 if (packageExists(new String[] { "com.nijiko.coelho.iConomy.iConomy", "com.nijiko.coelho.iConomy.system.Account" })) { Economy icon4 = new Economy_iConomy4(this); - getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, icon4, this, ServicePriority.High); + sm.register(net.milkbowl.vault.economy.Economy.class, icon4, this, ServicePriority.High); log.info(String.format("[%s][Economy] iConomy 4 found: ", getDescription().getName(), icon4.isEnabled() ? "Loaded" : "Waiting")); } // Try to load iConomy 5 if (packageExists(new String[] { "com.iConomy.iConomy", "com.iConomy.system.Account", "com.iConomy.system.Holdings" })) { Economy icon5 = new Economy_iConomy5(this); - getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, icon5, this, ServicePriority.High); + sm.register(net.milkbowl.vault.economy.Economy.class, icon5, this, ServicePriority.High); log.info(String.format("[%s][Economy] iConomy 5 found: %s", getDescription().getName(), icon5.isEnabled() ? "Loaded" : "Waiting")); } // Try to load iConomy 6 if (packageExists(new String[] { "com.iCo6.iConomy" })) { Economy icon6 = new Economy_iConomy6(this); - getServer().getServicesManager().register(Economy.class, icon6, this, ServicePriority.High); + sm.register(Economy.class, icon6, this, ServicePriority.High); log.info(String.format("[%s][Economy] iConomy 6 found: %s", getDescription().getName(), icon6.isEnabled() ? "Loaded" : "Waiting")); } //Try loading EconXP if (packageExists(new String[] { "ca.agnate.EconXP.EconXP" })) { Economy econ = new Economy_EconXP(this); - getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal); + sm.register(Economy.class, econ, this, ServicePriority.Normal); log.info(String.format("[%s][Economy] EconXP found: %s", getDescription().getName(), econ.isEnabled() ? "Loaded" : "Waiting")); } } @@ -273,49 +283,49 @@ public class Vault extends JavaPlugin { // Try to load PermissionsEx if (packageExists(new String[] { "ru.tehkode.permissions.bukkit.PermissionsEx" })) { Permission ePerms = new Permission_PermissionsEx(this); - getServer().getServicesManager().register(Permission.class, ePerms, this, ServicePriority.Highest); + sm.register(Permission.class, ePerms, this, ServicePriority.Highest); log.info(String.format("[%s][Permission] PermissionsEx found: %s", getDescription().getName(), ePerms.isEnabled() ? "Loaded" : "Waiting")); } //Try loading PermissionsBukkit if (packageExists(new String[] {"com.platymuus.bukkit.permissions.PermissionsPlugin"} )) { Permission pPerms = new Permission_PermissionsBukkit(this); - getServer().getServicesManager().register(Permission.class, pPerms, this, ServicePriority.Highest); + sm.register(Permission.class, pPerms, this, ServicePriority.Highest); log.info(String.format("[%s][Permission] PermissionsBukkit found: %s", getDescription().getName(), pPerms.isEnabled() ? "Loaded" : "Waiting")); } //Try to load bPermissions if (packageExists(new String[] {"de.bananaco.permissions.worlds.WorldPermissionsManager"} )) { Permission bPerms = new Permission_bPermissions(this); - getServer().getServicesManager().register(Permission.class, bPerms, this, ServicePriority.Highest); + sm.register(Permission.class, bPerms, this, ServicePriority.Highest); log.info(String.format("[%s][Permission] bPermissions found: %s", getDescription().getName(), bPerms.isEnabled() ? "Loaded" : "Waiting")); } //Try to load zPermission if (packageExists(new String[] {"org.tyrannyofheaven.bukkit.zPermissions"})) { Permission zPerms = new Permission_zPermissions(this); - getServer().getServicesManager().register(Permission.class, zPerms, this, ServicePriority.Highest); + sm.register(Permission.class, zPerms, this, ServicePriority.Highest); log.info(String.format("[%s][Permission] GroupManager found: %s", getDescription().getName(), zPerms.isEnabled() ? "Loaded" : "Waiting")); } // Try to load GroupManager if (packageExists(new String[] { "org.anjocaido.groupmanager.GroupManager" })) { Permission gPerms = new Permission_GroupManager(this); - getServer().getServicesManager().register(Permission.class, gPerms, this, ServicePriority.High); + sm.register(Permission.class, gPerms, this, ServicePriority.High); log.info(String.format("[%s][Permission] GroupManager found: %s", getDescription().getName(), gPerms.isEnabled() ? "Loaded" : "Waiting")); } // Try to load Permissions 3 (Yeti) if (packageExists(new String[] { "com.nijiko.permissions.ModularControl" })) { Permission nPerms = new Permission_Permissions3(this); - getServer().getServicesManager().register(Permission.class, nPerms, this, ServicePriority.High); + sm.register(Permission.class, nPerms, this, ServicePriority.High); log.info(String.format("[%s][Permission] Permissions 3 (Yeti) found: %s", getDescription().getName(), nPerms.isEnabled() ? "Loaded" : "Waiting")); } Permission perms = new Permission_SuperPerms(this); - getServer().getServicesManager().register(Permission.class, perms, this, ServicePriority.Lowest); + sm.register(Permission.class, perms, this, ServicePriority.Lowest); log.info(String.format("[%s][Permission] SuperPermissions loaded as backup permission system.", getDescription().getName())); - this.perms = getServer().getServicesManager().getRegistration(Permission.class).getProvider(); + this.perms = sm.getRegistration(Permission.class).getProvider(); } @Override diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_HeroTitles.java b/src/net/milkbowl/vault/chat/plugins/Chat_HeroTitles.java new file mode 100644 index 0000000..16432aa --- /dev/null +++ b/src/net/milkbowl/vault/chat/plugins/Chat_HeroTitles.java @@ -0,0 +1,268 @@ +package net.milkbowl.vault.chat.plugins; + +import java.util.logging.Logger; + +import org.bukkit.event.Event.Priority; +import org.bukkit.event.Event.Type; +import org.bukkit.event.server.PluginDisableEvent; +import org.bukkit.event.server.PluginEnableEvent; +import org.bukkit.event.server.ServerListener; +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; + +import com.herocraftonline.herotitles.HeroTitles; +import com.herocraftonline.herotitles.PlayerTitleManager; + +import net.milkbowl.vault.chat.Chat; +import net.milkbowl.vault.permission.Permission; + +public class Chat_HeroTitles extends Chat { + + private final Logger log = Logger.getLogger("Minecraft"); + private final String name = "HeroTitles"; + private PermissionServerListener permissionServerListener; + private Chat subChat; + private HeroTitles chat; + private Plugin plugin = null; + + public Chat_HeroTitles(Plugin plugin, Permission perms, Chat subChat) { + super(perms); + this.plugin = plugin; + this.subChat = subChat; + PluginManager pluginManager = this.plugin.getServer().getPluginManager(); + + permissionServerListener = new PermissionServerListener(this); + + pluginManager.registerEvent(Type.PLUGIN_ENABLE, permissionServerListener, Priority.Monitor, plugin); + pluginManager.registerEvent(Type.PLUGIN_DISABLE, permissionServerListener, Priority.Monitor, plugin); + + // Load Plugin in case it was loaded before + if (this.chat == null) { + Plugin chat = plugin.getServer().getPluginManager().getPlugin("HeroTitles"); + if (chat != null) { + this.chat = (HeroTitles) chat; + log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), "HeroTitles")); + } + } + } + + private class PermissionServerListener extends ServerListener { + Chat_HeroTitles chat = null; + + public PermissionServerListener(Chat_HeroTitles chat) { + this.chat = chat; + } + + public void onPluginEnable(PluginEnableEvent event) { + if (this.chat.chat == null) { + Plugin chat = plugin.getServer().getPluginManager().getPlugin("HeroTitles"); + if (chat != null) { + this.chat.chat = (HeroTitles) chat; + log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), "HeroTitles")); + } + } + } + + public void onPluginDisable(PluginDisableEvent event) { + if (this.chat.chat != null) { + if (event.getPlugin().getDescription().getName().equals("HeroTitles")) { + this.chat.chat = null; + log.info(String.format("[%s][Chat] %s un-hooked.", plugin.getDescription().getName(), "HeroTitles")); + } + } + } + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean isEnabled() { + return chat != null && chat.isEnabled(); + } + + @Override + public String getPlayerPrefix(String world, String player) { + return PlayerTitleManager.getTitlePrefix(player).data; + } + + @Override + public void setPlayerPrefix(String world, String player, String prefix) { + PlayerTitleManager.setTitlePrefix(player, prefix); + } + + @Override + public String getPlayerSuffix(String world, String player) { + return PlayerTitleManager.getTitleSuffix(player).data; + } + + @Override + public void setPlayerSuffix(String world, String player, String suffix) { + PlayerTitleManager.setTitleSuffix(player, suffix); + } + + @Override + public String getGroupPrefix(String world, String group) { + if (subChat != null) + return subChat.getGroupPrefix(world, group); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupPrefix(String world, String group, String prefix) { + if (subChat != null) + subChat.setGroupPrefix(world, group, prefix); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public String getGroupSuffix(String world, String group) { + if (subChat != null) + return subChat.getGroupSuffix(world, group); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupSuffix(String world, String group, String suffix) { + if (subChat != null) + subChat.setGroupSuffix(world, group, suffix); + } + + @Override + public int getPlayerInfoInteger(String world, String player, String node, int defaultValue) { + if (subChat != null) + return subChat.getPlayerInfoInteger(world, player, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setPlayerInfoInteger(String world, String player, String node, int value) { + if (subChat != null) + subChat.setPlayerInfoInteger(world, player, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public int getGroupInfoInteger(String world, String group, String node, int defaultValue) { + if (subChat != null) + return subChat.getGroupInfoInteger(world, group, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupInfoInteger(String world, String group, String node, int value) { + if (subChat != null) + subChat.setGroupInfoInteger(world, group, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public double getPlayerInfoDouble(String world, String player, String node, double defaultValue) { + if (subChat != null) + return subChat.getPlayerInfoDouble(world, player, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setPlayerInfoDouble(String world, String player, String node, double value) { + if (subChat != null) + subChat.setPlayerInfoDouble(world, player, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + + } + + @Override + public double getGroupInfoDouble(String world, String group, String node, double defaultValue) { + if (subChat != null) + return subChat.getGroupInfoDouble(world, group, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupInfoDouble(String world, String group, String node, double value) { + if (subChat != null) + subChat.setGroupInfoDouble(world, group, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue) { + if (subChat != null) + return subChat.getPlayerInfoBoolean(world, player, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setPlayerInfoBoolean(String world, String player, String node, boolean value) { + if (subChat != null) + subChat.setPlayerInfoBoolean(world, player, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + + } + + @Override + public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue) { + if (subChat != null) + return subChat.getGroupInfoBoolean(world, group, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupInfoBoolean(String world, String group, String node, boolean value) { + if (subChat != null) + subChat.setGroupInfoBoolean(world, group, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public String getPlayerInfoString(String world, String player, String node, String defaultValue) { + if (node.equals("color")) + return PlayerTitleManager.getTitleColor(player).toString(); + + if (subChat != null) + return subChat.getPlayerInfoString(world, player, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setPlayerInfoString(String world, String player, String node, String value) { + if (subChat != null) + subChat.setPlayerInfoString(world, player, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public String getGroupInfoString(String world, String group, String node, String defaultValue) { + if (subChat != null) + return subChat.getGroupInfoString(world, group, node, defaultValue); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } + + @Override + public void setGroupInfoString(String world, String group, String node, String value) { + if (subChat != null) + subChat.setGroupInfoString(world, group, node, value); + + throw new UnsupportedOperationException("HeroTitles does not support info nodes!"); + } +} diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_iChat.java b/src/net/milkbowl/vault/chat/plugins/Chat_iChat.java index cd2877f..485f7d0 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_iChat.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_iChat.java @@ -40,7 +40,7 @@ public class Chat_iChat extends Chat { Plugin chat = plugin.getServer().getPluginManager().getPlugin("iChat"); if (chat != null) { iChat = ((iChat) chat).API; - log.info(String.format("[%s][Chat] %s hooked.", chat.getDescription().getName(), "iChat")); + log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), "iChat")); } } } @@ -57,7 +57,7 @@ public class Chat_iChat extends Chat { Plugin chat = plugin.getServer().getPluginManager().getPlugin("iChat"); if (chat != null) { this.chat.iChat = ((iChat) chat).API; - log.info(String.format("[%s][Chat] %s hooked.", chat.getDescription().getName(), "iChat")); + log.info(String.format("[%s][Chat] %s hooked.", plugin.getDescription().getName(), "iChat")); } } }