Added Hidendra's Plugin Metrics to mcMMO.

This commit is contained in:
nossr50 2012-02-11 12:12:50 -08:00
parent 70756c2a2e
commit 71c14ab07b
2 changed files with 18 additions and 1 deletions

View File

@ -2,7 +2,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>1.2.11</version>
<name>mcMMO</name>
<url>https://github.com/TheYeti/mcMMO</url>
<issueManagement>
@ -122,4 +121,5 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<version>1.1.12-dev</version>
</project>

View File

@ -51,6 +51,7 @@ import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.PluginManager;
@ -93,6 +94,7 @@ public class mcMMO extends JavaPlugin
public void onEnable()
{
final Plugin thisPlugin = this;
mcmmo = this.getFile();
new File(maindirectory).mkdir();
@ -167,6 +169,21 @@ public class mcMMO extends JavaPlugin
FileManager FM = SpoutManager.getFileManager();
FM.addToPreLoginCache(this, SpoutStuff.getFiles());
}
//Plugin Metrics running in a new thread
new Thread(new Runnable() {
public void run() {
try {
// create a new metrics object
Metrics metrics = new Metrics();
// 'this' in this context is the Plugin object
metrics.beginMeasuringPlugin(thisPlugin);
} catch (IOException e) {
// Failed to submit the stats :-(
}
}
}).start();
}
public PlayerProfile getPlayerProfile(Player player)