Skip to content

Commit 7d997cc

Browse files
committed
Updated code to work with bStats's latest API version
1 parent 55d1ff2 commit 7d997cc

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lobbybalancer.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<orderEntry type="library" name="Maven: me.jaimemartz:faucet-bungee:1.0" level="project" />
3939
<orderEntry type="library" name="Maven: me.jaimemartz:faucet-core:1.0" level="project" />
4040
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.4" level="project" />
41-
<orderEntry type="library" name="Maven: org.bstats:bstats-bungeecord:1.1" level="project" />
41+
<orderEntry type="library" name="Maven: org.bstats:bstats-bungeecord:1.2-SNAPSHOT" level="project" />
4242
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
4343
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
4444
</component>

src/main/java/me/jaimemartz/lobbybalancer/LobbyBalancer.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.inventivetalent.update.bungee.BungeeUpdater;
2020

2121
import java.io.IOException;
22+
import java.util.concurrent.Callable;
2223
import java.util.logging.Level;
2324

2425
public class LobbyBalancer extends Plugin {
@@ -49,12 +50,7 @@ public void onEnable() {
4950

5051
//Metrics (https://bstats.org/)
5152
Metrics metrics = new Metrics(this);
52-
metrics.addCustomChart(new Metrics.SingleLineChart("configured_sections") {
53-
@Override
54-
public int getValue() {
55-
return sectionManager.getSections().size();
56-
}
57-
});
53+
metrics.addCustomChart(new Metrics.SingleLineChart("configred_sections", () -> sectionManager.getSections().size()));
5854
}
5955

6056
private void enable() {

0 commit comments

Comments
 (0)