schedule the metrics to start after the server is finished loading up

This commit is contained in:
Sleaker 2012-01-31 17:37:42 -08:00
parent cf7bc4079f
commit 0a677273c6

View File

@ -133,8 +133,20 @@ public class Vault extends JavaPlugin {
// Load up the Plugin metrics
try {
metrics = new Metrics(getDescription().getVersion());
metrics.findCustomData(this);
metrics.beginMeasuringPlugin(this);
final Vault plugin = this;
this.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
public void run() {
metrics.findCustomData(plugin);
try {
metrics.beginMeasuringPlugin(plugin);
} catch (IOException e) {
// ignore
}
}
}, 10);
} catch (IOException e) {
// ignore exception
}