mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-03 05:51:28 +01:00
Fixed sponge metrics
This commit is contained in:
parent
23929d73ca
commit
5ad7f3f591
@ -14,6 +14,7 @@ import com.djrapitops.plugin.api.utility.log.DebugLog;
|
|||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import com.djrapitops.plugin.settings.ColorScheme;
|
import com.djrapitops.plugin.settings.ColorScheme;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
|
import org.bstats.sponge.Metrics;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.spongepowered.api.config.ConfigDir;
|
import org.spongepowered.api.config.ConfigDir;
|
||||||
import org.spongepowered.api.event.Listener;
|
import org.spongepowered.api.event.Listener;
|
||||||
@ -27,6 +28,9 @@ import java.io.InputStream;
|
|||||||
@Plugin(id = "plan", name = "Plan", version = "4.4.3", description = "Player Analytics Plugin by Rsl1122", authors = {"Rsl1122"})
|
@Plugin(id = "plan", name = "Plan", version = "4.4.3", description = "Player Analytics Plugin by Rsl1122", authors = {"Rsl1122"})
|
||||||
public class PlanSponge extends SpongePlugin implements PlanPlugin {
|
public class PlanSponge extends SpongePlugin implements PlanPlugin {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Metrics metrics;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Logger logger;
|
private Logger logger;
|
||||||
|
|
||||||
@ -58,7 +62,7 @@ public class PlanSponge extends SpongePlugin implements PlanPlugin {
|
|||||||
locale = system.getLocaleSystem().getLocale();
|
locale = system.getLocaleSystem().getLocale();
|
||||||
system.enable();
|
system.enable();
|
||||||
|
|
||||||
new BStatsSponge().registerMetrics();
|
new BStatsSponge(metrics).registerMetrics();
|
||||||
|
|
||||||
Log.info(locale.getString(PluginLang.ENABLED));
|
Log.info(locale.getString(PluginLang.ENABLED));
|
||||||
} catch (AbstractMethodError e) {
|
} catch (AbstractMethodError e) {
|
||||||
|
@ -5,18 +5,22 @@ import com.djrapitops.plan.system.info.connection.ConnectionSystem;
|
|||||||
import com.djrapitops.plugin.api.utility.log.Log;
|
import com.djrapitops.plugin.api.utility.log.Log;
|
||||||
import org.bstats.sponge.Metrics;
|
import org.bstats.sponge.Metrics;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class BStatsSponge {
|
public class BStatsSponge {
|
||||||
|
|
||||||
@Inject
|
private final Metrics metrics;
|
||||||
private Metrics metrics;
|
|
||||||
|
public BStatsSponge(Metrics metrics) {
|
||||||
|
this.metrics = metrics;
|
||||||
|
}
|
||||||
|
|
||||||
public void registerMetrics() {
|
public void registerMetrics() {
|
||||||
Log.logDebug("Enable", "Enabling bStats Metrics.");
|
Log.logDebug("Enable", "Enabling bStats Metrics.");
|
||||||
if (metrics != null) {
|
if (metrics != null) {
|
||||||
registerConfigSettingGraphs();
|
registerConfigSettingGraphs();
|
||||||
|
} else {
|
||||||
|
Log.debug("Metrics not injected properly.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user