Chimera Wing Usage Tracker/Graph

This commit is contained in:
NuclearW 2013-02-15 20:59:38 -05:00
parent 704f7374d2
commit 6eb125c913
2 changed files with 20 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.util.metrics.MetricsManager;
public final class ChimaeraWing {
private ChimaeraWing() {}
@ -49,6 +50,7 @@ public final class ChimaeraWing {
player.teleport(player.getWorld().getSpawnLocation());
}
MetricsManager.chimeraWingUsed();
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass"));
}
else if (!SkillTools.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) {

View File

@ -13,10 +13,14 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.turt2live.metrics.EMetrics;
import com.turt2live.metrics.Metrics;
import com.turt2live.metrics.Metrics.Graph;
import com.turt2live.metrics.tracker.Tracker;
public class MetricsManager {
private static boolean setup = false;
private static Tracker chimeraUseTracker;
private static Tracker chimeraServerUseTracker;
public static void setup() {
if (setup) {
return;
@ -183,6 +187,15 @@ public class MetricsManager {
}
});
// Chimera Wing Usage Trackers
final String chimeraGraphName = "Chimera Wing Usage";
chimeraUseTracker = EMetrics.createBasicTracker(chimeraGraphName, "Player use");
chimeraServerUseTracker = EMetrics.createEnabledTracker(chimeraGraphName, "Server use");
emetrics.addTracker(chimeraUseTracker);
emetrics.addTracker(chimeraServerUseTracker);
// Chimera Wing Enabled Graph
Graph chimeraGraph = metrics.createGraph("Chimera Wing");
@ -210,4 +223,9 @@ public class MetricsManager {
}
}
}
public static void chimeraWingUsed() {
chimeraUseTracker.increment(1);
chimeraServerUseTracker.increment(1);
}
}