mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-12 14:58:26 +02: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.settings.ColorScheme;
|
||||
import com.google.inject.Inject;
|
||||
import org.bstats.sponge.Metrics;
|
||||
import org.slf4j.Logger;
|
||||
import org.spongepowered.api.config.ConfigDir;
|
||||
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"})
|
||||
public class PlanSponge extends SpongePlugin implements PlanPlugin {
|
||||
|
||||
@Inject
|
||||
private Metrics metrics;
|
||||
|
||||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@ -58,7 +62,7 @@ public class PlanSponge extends SpongePlugin implements PlanPlugin {
|
||||
locale = system.getLocaleSystem().getLocale();
|
||||
system.enable();
|
||||
|
||||
new BStatsSponge().registerMetrics();
|
||||
new BStatsSponge(metrics).registerMetrics();
|
||||
|
||||
Log.info(locale.getString(PluginLang.ENABLED));
|
||||
} catch (AbstractMethodError e) {
|
||||
|
@ -5,18 +5,22 @@ import com.djrapitops.plan.system.info.connection.ConnectionSystem;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
import org.bstats.sponge.Metrics;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.Serializable;
|
||||
|
||||
public class BStatsSponge {
|
||||
|
||||
@Inject
|
||||
private Metrics metrics;
|
||||
private final Metrics metrics;
|
||||
|
||||
public BStatsSponge(Metrics metrics) {
|
||||
this.metrics = metrics;
|
||||
}
|
||||
|
||||
public void registerMetrics() {
|
||||
Log.logDebug("Enable", "Enabling bStats Metrics.");
|
||||
if (metrics != null) {
|
||||
registerConfigSettingGraphs();
|
||||
} else {
|
||||
Log.debug("Metrics not injected properly.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user