mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-27 13:07:23 +01:00
fix not setting p3 plugin properly for chat support when the plugin is
loaded later on.
This commit is contained in:
parent
4e93a060e6
commit
958a8c102f
@ -48,10 +48,11 @@ public class Chat_Permissions3 extends Chat {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (chat == null) {
|
if (chat == null) {
|
||||||
Plugin perms = event.getPlugin();
|
Plugin permChat = event.getPlugin();
|
||||||
if(perms.getDescription().getName().equals("Permissions") && perms.getDescription().getVersion().startsWith("3")) {
|
if(permChat.getDescription().getName().equals("Permissions") && permChat.getDescription().getVersion().startsWith("3")) {
|
||||||
if (perms.isEnabled()) {
|
if (permChat.isEnabled()) {
|
||||||
chat = (Permissions) perms;
|
chat = (Permissions) permChat;
|
||||||
|
perms = chat.getHandler();
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), name));
|
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 (chat != null) {
|
||||||
if (event.getPlugin().getDescription().getName().equals("Permissions")) {
|
if (event.getPlugin().getDescription().getName().equals("Permissions")) {
|
||||||
chat = null;
|
chat = null;
|
||||||
|
perms = null;
|
||||||
log.info(String.format("[%s][Permission] %s un-hooked.", plugin.getDescription().getName(), name));
|
log.info(String.format("[%s][Permission] %s un-hooked.", plugin.getDescription().getName(), name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user