Continue to attempt to load Citizens post-initialization, fixes #934

This commit is contained in:
PikaMug 2019-09-24 01:27:16 -04:00
parent f27ad6466f
commit c9e686b1dd

View File

@ -89,6 +89,15 @@ public class Dependencies {
}
public CitizensPlugin getCitizens() {
if (citizens == null) {
if (isPluginAvailable("Citizens")) {
try {
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
} catch (Exception e) {
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
}
}
}
return citizens;
}
@ -124,12 +133,12 @@ public class Dependencies {
}
void init() {
try {
if (isPluginAvailable("Citizens")) {
if (isPluginAvailable("Citizens")) {
try {
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
} catch (Exception e) {
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
}
} catch (Exception e) {
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
}
if (isPluginAvailable("WorldGuard")) {
worldGuardApi = new WorldGuardAPI(plugin.getServer().getPluginManager().getPlugin("WorldGuard"));