mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-09 04:09:35 +01: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 Heroes heroes = null;
|
||||||
private static PhatLoots phatLoots = null;
|
private static PhatLoots phatLoots = null;
|
||||||
private static PlaceholderAPIPlugin placeholder = null;
|
private static PlaceholderAPIPlugin placeholder = null;
|
||||||
private static CitizensPlugin citizens;
|
private static CitizensPlugin citizens = null;
|
||||||
private static Denizen denizen = null;
|
private static Denizen denizen = null;
|
||||||
private static CitizensBooksAPI citizensBooks = null;
|
private static CitizensBooksAPI citizensBooks = null;
|
||||||
private static DungeonsXL dungeons = null;
|
private static DungeonsXL dungeons = null;
|
||||||
@ -109,6 +109,9 @@ public class Dependencies {
|
|||||||
try {
|
try {
|
||||||
if (isPluginAvailable("Citizens")) {
|
if (isPluginAvailable("Citizens")) {
|
||||||
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
|
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
|
||||||
|
if (citizens.getNPCRegistry() == null) {
|
||||||
|
citizens = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
|
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())) {
|
if (evt.getFrom().getBlock().equals(evt.getTo().getBlock())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plugin.getDependencies().getCitizens() != null && CitizensAPI.getNPCRegistry() != null) {
|
if (plugin.getDependencies().getCitizens() != null) {
|
||||||
if (CitizensAPI.getNPCRegistry().isNPC(evt.getPlayer())) {
|
if (CitizensAPI.getNPCRegistry().isNPC(evt.getPlayer())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user