mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-12 07:28:06 +02:00
Avoid enabling Citizens if NPCRegistry is null, fixes #763
This commit is contained in:
parent
8957c68bdf
commit
7cae9d8560
@ -32,7 +32,7 @@ public class Dependencies {
|
||||
private static Heroes heroes = null;
|
||||
private static PhatLoots phatLoots = null;
|
||||
private static PlaceholderAPIPlugin placeholder = null;
|
||||
private static CitizensPlugin citizens;
|
||||
private static CitizensPlugin citizens = null;
|
||||
private static Denizen denizen = null;
|
||||
private static CitizensBooksAPI citizensBooks = null;
|
||||
private static DungeonsXL dungeons = null;
|
||||
@ -109,6 +109,9 @@ public class Dependencies {
|
||||
try {
|
||||
if (isPluginAvailable("Citizens")) {
|
||||
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
|
||||
if (citizens.getNPCRegistry() == null) {
|
||||
citizens = null;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
|
||||
|
@ -793,7 +793,7 @@ public class PlayerListener implements Listener {
|
||||
if (evt.getFrom().getBlock().equals(evt.getTo().getBlock())) {
|
||||
return;
|
||||
}
|
||||
if (plugin.getDependencies().getCitizens() != null && CitizensAPI.getNPCRegistry() != null) {
|
||||
if (plugin.getDependencies().getCitizens() != null) {
|
||||
if (CitizensAPI.getNPCRegistry().isNPC(evt.getPlayer())) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user