mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 18:45:27 +01:00
Begin particle task alongside Citizens post-enable
This commit is contained in:
parent
941e06b115
commit
be41d61441
@ -124,17 +124,27 @@ public class Dependencies {
|
||||
}
|
||||
|
||||
public CitizensPlugin getCitizens() {
|
||||
if (citizens == null && isPluginAvailable("Citizens")) {
|
||||
if (citizens == null) {
|
||||
enableCitizens();
|
||||
}
|
||||
return citizens;
|
||||
}
|
||||
|
||||
public void enableCitizens() {
|
||||
if (isPluginAvailable("Citizens")) {
|
||||
try {
|
||||
citizens = (CitizensPlugin) plugin.getServer().getPluginManager().getPlugin("Citizens");
|
||||
plugin.getServer().getPluginManager().registerEvents(plugin.getNpcListener(), plugin);
|
||||
if (plugin.getSettings().canNpcEffects()) {
|
||||
plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, plugin.getNpcEffectThread(),
|
||||
20, 20);
|
||||
}
|
||||
plugin.getLogger().info("Successfully linked Quests with Citizens "
|
||||
+ citizens.getDescription().getVersion());
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().warning("Legacy version of Citizens found. Citizens in Quests not enabled.");
|
||||
}
|
||||
}
|
||||
return citizens;
|
||||
}
|
||||
|
||||
public void disableCitizens() {
|
||||
|
@ -133,7 +133,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
private ItemListener itemListener;
|
||||
private NpcListener npcListener;
|
||||
private PlayerListener playerListener;
|
||||
private NpcEffectThread effThread;
|
||||
private NpcEffectThread effectThread;
|
||||
private PlayerMoveThread moveThread;
|
||||
private DungeonsListener dungeonsListener;
|
||||
private PartiesListener partiesListener;
|
||||
@ -155,7 +155,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
playerListener = new PlayerListener(this);
|
||||
dungeonsListener = new DungeonsListener();
|
||||
partiesListener = new PartiesListener();
|
||||
effThread = new NpcEffectThread(this);
|
||||
effectThread = new NpcEffectThread(this);
|
||||
moveThread = new PlayerMoveThread(this);
|
||||
questFactory = new QuestFactory(this);
|
||||
actionFactory = new ActionFactory(this);
|
||||
@ -215,11 +215,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
// 10 - Register listeners
|
||||
getServer().getPluginManager().registerEvents(blockListener, this);
|
||||
getServer().getPluginManager().registerEvents(itemListener, this);
|
||||
if (depends.getCitizens() != null) { // #getCitizens takes care of registering npcListener
|
||||
if (settings.canNpcEffects()) {
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, effThread, 20, 20);
|
||||
}
|
||||
}
|
||||
depends.enableCitizens();
|
||||
getServer().getPluginManager().registerEvents(playerListener, this);
|
||||
if (settings.getStrictPlayerMovement() > 0) {
|
||||
final long ticks = settings.getStrictPlayerMovement() * 20;
|
||||
@ -466,6 +462,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
return partiesListener;
|
||||
}
|
||||
|
||||
public NpcEffectThread getNpcEffectThread() {
|
||||
return effectThread;
|
||||
}
|
||||
|
||||
public DenizenTrigger getDenizenTrigger() {
|
||||
return trigger;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user