mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-23 19:16:31 +01:00
Use PluginEnableEvent instead of searching for the Plugin during onPluginEnable in P3
This commit is contained in:
parent
7c2e3a0c55
commit
88b2bfa048
@ -90,10 +90,9 @@ public class Permission_Permissions3 extends Permission {
|
|||||||
|
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
if (permission.permission == null) {
|
if (permission.permission == null) {
|
||||||
Plugin perms = plugin.getServer().getPluginManager().getPlugin("Permissions");
|
Plugin perms = event.getPlugin();
|
||||||
|
if(perms.getDescription().getName().equals("Permissions") && perms.getDescription().getVersion().startsWith("3")) {
|
||||||
if (perms != null) {
|
if (perms.isEnabled()) {
|
||||||
if (perms.isEnabled() && perms.getDescription().getVersion().startsWith("3")) {
|
|
||||||
permission.permission = (Permissions) perms;
|
permission.permission = (Permissions) perms;
|
||||||
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
log.info(String.format("[%s][Permission] %s hooked.", plugin.getDescription().getName(), permission.name));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user