Updated code to work with bStats's latest API version

This commit is contained in:
Jaime Martinez Rincon 2017-04-21 15:31:01 +02:00
parent 55d1ff22ee
commit 7d997ccfa7
2 changed files with 3 additions and 7 deletions

View File

@ -38,7 +38,7 @@
<orderEntry type="library" name="Maven: me.jaimemartz:faucet-bungee:1.0" level="project" /> <orderEntry type="library" name="Maven: me.jaimemartz:faucet-bungee:1.0" level="project" />
<orderEntry type="library" name="Maven: me.jaimemartz:faucet-core:1.0" level="project" /> <orderEntry type="library" name="Maven: me.jaimemartz:faucet-core:1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" /> <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
<orderEntry type="library" name="Maven: org.bstats:bstats-bungeecord:1.1" level="project" /> <orderEntry type="library" name="Maven: org.bstats:bstats-bungeecord:1.2-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component> </component>

View File

@ -19,6 +19,7 @@ import org.bstats.Metrics;
import org.inventivetalent.update.bungee.BungeeUpdater; import org.inventivetalent.update.bungee.BungeeUpdater;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.Callable;
import java.util.logging.Level; import java.util.logging.Level;
public class LobbyBalancer extends Plugin { public class LobbyBalancer extends Plugin {
@ -49,12 +50,7 @@ public class LobbyBalancer extends Plugin {
//Metrics (https://bstats.org/) //Metrics (https://bstats.org/)
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);
metrics.addCustomChart(new Metrics.SingleLineChart("configured_sections") { metrics.addCustomChart(new Metrics.SingleLineChart("configred_sections", () -> sectionManager.getSections().size()));
@Override
public int getValue() {
return sectionManager.getSections().size();
}
});
} }
private void enable() { private void enable() {