mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Chimera Wing Usage Tracker/Graph
This commit is contained in:
parent
704f7374d2
commit
6eb125c913
@ -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()) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user