LimitedCreative/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java

35 lines
952 B
Java
Raw Normal View History

2013-02-01 21:25:43 +00:00
package de.jaschastarke.minecraft.limitedcreative;
import java.io.IOException;
2013-02-01 21:25:43 +00:00
import org.bukkit.event.Listener;
import de.jaschastarke.bukkit.lib.CoreModule;
import de.jaschastarke.bukkit.tools.stats.IStatistics;
import de.jaschastarke.bukkit.tools.stats.PiwikStatistics;
public class FeatureMetrics extends CoreModule<LimitedCreative> implements Listener {
public FeatureMetrics(LimitedCreative plugin) {
super(plugin);
}
private IStatistics metric;
@Override
public void onEnable() {
super.onEnable();
2013-02-01 21:25:43 +00:00
metric = new PiwikStatistics(plugin);
}
@Override
public void onDisable() {
super.onDisable();
2013-02-01 21:25:43 +00:00
metric.unregister();
}
public void track(String event) throws IOException {
2013-02-01 21:25:43 +00:00
if (metric == null)
throw new IllegalAccessError("The feature hasn't been enabled");
metric.trackEvent(event);
}
}