Made it actually work, lawl

This commit is contained in:
David Marby 2012-05-07 19:33:02 +02:00
parent ef24c160ad
commit dfe92470e5

View File

@ -19,6 +19,7 @@ import net.citizensnpcs.api.util.DatabaseStorage;
import net.citizensnpcs.api.util.NBTStorage; import net.citizensnpcs.api.util.NBTStorage;
import net.citizensnpcs.api.util.Storage; import net.citizensnpcs.api.util.Storage;
import net.citizensnpcs.api.util.YamlStorage; import net.citizensnpcs.api.util.YamlStorage;
import net.citizensnpcs.api.npc.character.Character;
import net.citizensnpcs.command.CommandManager; import net.citizensnpcs.command.CommandManager;
import net.citizensnpcs.command.Injector; import net.citizensnpcs.command.Injector;
import net.citizensnpcs.command.command.AdminCommands; import net.citizensnpcs.command.command.AdminCommands;
@ -167,15 +168,14 @@ public class Citizens extends JavaPlugin {
if (getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() { if (getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override @Override
public void run() { public void run() {
setupNPCs(); setupNPCs();
// Run metrics "last"
startMetrics();
} }
}) == -1) { }) == -1) {
Messaging.log(Level.SEVERE, "Issue enabling plugin. Disabling."); Messaging.log(Level.SEVERE, "Issue enabling plugin. Disabling.");
getServer().getPluginManager().disablePlugin(this); getServer().getPluginManager().disablePlugin(this);
} }
// Run metrics last
startMetrics();
} }
private void startMetrics() { private void startMetrics() {
@ -191,8 +191,9 @@ public class Citizens extends JavaPlugin {
} }
}); });
Metrics.Graph graph = metrics.createGraph("Character Type Usage"); Metrics.Graph graph = metrics.createGraph("Character Type Usage");
for(Object i : characterManager.getRegistered()){ Messaging.log("Starting Metrics");
graph.addPlotter(new Metrics.Plotter(i.toString()) { for(Character character : characterManager.getRegistered()){
graph.addPlotter(new Metrics.Plotter(character.getName()) {
@Override @Override
public int getValue() { public int getValue() {
return 1; return 1;