Now using the latest version of Metrics to stop a NPE

This commit is contained in:
nossr50
2012-04-26 18:41:30 -07:00
parent 3c02286a08
commit 9d21aa36de
2 changed files with 256 additions and 209 deletions

View File

@@ -14,12 +14,7 @@ import com.gmail.nossr50.listeners.PlayerListener;
import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party;
import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -123,24 +118,17 @@ public class mcMMO extends JavaPlugin {
registerCommands();
if (Config.getStatsTrackingEnabled()) {
//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(p);
}
catch (IOException e) {
System.out.println("Failed to submit stats.");
}
try {
Metrics metrics = new Metrics(this);
metrics.start();
}
}).start();
catch (IOException e) {
System.out.println("Failed to submit stats.");
}
}
}
/**
* Get profile of the player.
* </br>