From 958a8c102fab57ffd4d09dedf99548b024105f47 Mon Sep 17 00:00:00 2001 From: Sleaker Date: Sun, 5 Feb 2012 19:26:22 -0800 Subject: [PATCH] fix not setting p3 plugin properly for chat support when the plugin is loaded later on. --- .../milkbowl/vault/chat/plugins/Chat_Permissions3.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java index 8478f42..a12dfb8 100644 --- a/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java +++ b/src/net/milkbowl/vault/chat/plugins/Chat_Permissions3.java @@ -48,10 +48,11 @@ public class Chat_Permissions3 extends Chat { @EventHandler(priority = EventPriority.MONITOR) public void onPluginEnable(PluginEnableEvent event) { if (chat == null) { - Plugin perms = event.getPlugin(); - if(perms.getDescription().getName().equals("Permissions") && perms.getDescription().getVersion().startsWith("3")) { - if (perms.isEnabled()) { - chat = (Permissions) perms; + Plugin permChat = event.getPlugin(); + if(permChat.getDescription().getName().equals("Permissions") && permChat.getDescription().getVersion().startsWith("3")) { + if (permChat.isEnabled()) { + chat = (Permissions) permChat; + perms = chat.getHandler(); log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name)); } } @@ -63,6 +64,7 @@ public class Chat_Permissions3 extends Chat { if (chat != null) { if (event.getPlugin().getDescription().getName().equals("Permissions")) { chat = null; + perms = null; log.info(String.format("[%s][Permission] %s un-hooked.", plugin.getDescription().getName(), name)); } }