mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
Only register Objective Listeners once.
This commit is contained in:
parent
f11e679325
commit
65862a5bd1
@ -672,6 +672,17 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
count++;
|
||||
getLogger().info("Loaded Module: " + name + " by " + author);
|
||||
|
||||
try {
|
||||
getServer().getPluginManager().registerEvents(objective, this);
|
||||
getLogger().info("Registered events for custom objective \"" + name + "\"");
|
||||
} catch (Exception ex) {
|
||||
getLogger().warning("Failed to register events for custom objective \"" + name + "\". Does the objective class listen for events?");
|
||||
if (debug) {
|
||||
getLogger().warning("Error log:");
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -4203,20 +4214,6 @@ try{
|
||||
oStage.customObjectives.add(found);
|
||||
oStage.customObjectiveCounts.add(count);
|
||||
oStage.customObjectiveData.add(data);
|
||||
|
||||
try {
|
||||
|
||||
getServer().getPluginManager().registerEvents(found, this);
|
||||
getLogger().info("Registered events for custom objective \"" + name + "\" in Stage " + s2 + " of Quest \"" + quest.name + "\".");
|
||||
|
||||
} catch (Exception e) {
|
||||
getLogger().warning("Failed to register events for custom objective \"" + name + "\" in Stage " + s2 + " of Quest \"" + quest.name + "\". Does the objective class listen for events?");
|
||||
if (debug) {
|
||||
getLogger().warning("Error log:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user