Add Storage type plotters, update version to 2.0.6-SNAPSHOT

This commit is contained in:
fullwall 2012-12-19 22:26:46 +08:00
parent 3a24dbd689
commit c4cfd02b1a
3 changed files with 26 additions and 2 deletions

View File

@ -6,13 +6,13 @@
<groupId>net.citizensnpcs</groupId>
<artifactId>citizens</artifactId>
<version>2.0.5</version>
<version>2.0.6-SNAPSHOT</version>
<name>Citizens</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>LATEST</craftbukkit.version>
<citizensapi.version>2.0.5</citizensapi.version>
<citizensapi.version>2.0.6-SNAPSHOT</citizensapi.version>
<vault.version>1.2.19-SNAPSHOT</vault.version>
<powermock.version>1.4.12</powermock.version>
<build.number>Unknown</build.number>

View File

@ -314,6 +314,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
});
traitFactory.addPlotters(metrics.createGraph("traits"));
saves.addPlotters(metrics.createGraph("Storage type"));
metrics.start();
} catch (IOException e) {
Messaging.logTr(Messages.METRICS_ERROR_NOTIFICATION, e.getMessage());

View File

@ -3,6 +3,8 @@ package net.citizensnpcs;
import java.io.File;
import java.sql.SQLException;
import net.citizensnpcs.Metrics.Graph;
import net.citizensnpcs.Metrics.Plotter;
import net.citizensnpcs.Settings.Setting;
import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry;
@ -96,4 +98,25 @@ public class NPCDataStore {
return null;
return new NPCDataStore(saves);
}
public void addPlotters(Graph graph) {
graph.addPlotter(new Plotter("Database") {
@Override
public int getValue() {
return root instanceof DatabaseStorage ? 1 : 0;
}
});
graph.addPlotter(new Plotter("YAML") {
@Override
public int getValue() {
return root instanceof YamlStorage ? 1 : 0;
}
});
graph.addPlotter(new Plotter("NBT") {
@Override
public int getValue() {
return root instanceof NBTStorage ? 1 : 0;
}
});
}
}