From a652fcd026a87622b6ce953afb348cc5585f9873 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Sat, 11 Feb 2012 16:11:04 -0500 Subject: [PATCH] Optional stats tracking I still don't like stats tracking. --- .../gmail/nossr50/config/LoadProperties.java | 3 +- src/main/java/com/gmail/nossr50/mcMMO.java | 30 ++++++++++--------- src/main/resources/config.yml | 2 ++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index 955aa60eb..3fa3b9c42 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -43,7 +43,7 @@ public class LoadProperties { diamondArmor, woodenTools, stoneTools, ironTools, goldTools, diamondTools, enderPearl, blazeRod, records, glowstoneDust, fishingDiamonds, aDisplayNames, pDisplayNames, enableSmoothToMossy, - enableDirtToGrass; + enableDirtToGrass, statsTracking; public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone, @@ -298,6 +298,7 @@ public class LoadProperties { enableMySpawn = readBoolean("General.MySpawn.Enabled", true); enableRegen = readBoolean("General.HP_Regeneration.Enabled", true); saveInterval = readInteger("General.Save_Interval", 10); + statsTracking = readBoolean("General.Stats_Tracking", true); enableCobbleToMossy = readBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); enableSmoothToMossy = readBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 4163ec304..a88b7f578 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -170,20 +170,22 @@ public class mcMMO extends JavaPlugin 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(); + if(LoadProperties.statsTracking) { + //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) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0bd57313b..530310201 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -259,6 +259,8 @@ General: Enabled: true #Amount of time (in minutes) to wait between saves of player information Save_Interval: 10 + #Allow mcMMO to report on basic anonymous useage + Stats_Tracking: true Excavation: Drops: Cake: true