mirror of
https://codeberg.org/Andre601/AdvancedServerList.git
synced 2026-11-05 09:00:15 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3851fa5f67 |
No files matched your search
+5
-1
@@ -34,6 +34,7 @@ import ch.andre601.advancedserverlist.core.interfaces.PluginCore;
|
||||
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.bstats.bungeecord.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
@@ -65,7 +66,10 @@ public class BungeeCordCore extends Plugin implements PluginCore{
|
||||
|
||||
@Override
|
||||
public void loadMetrics(){
|
||||
new Metrics(this, 15585);
|
||||
new Metrics(this, 15585).addCustomChart(new SimplePie("profiles",
|
||||
() -> String.valueOf(core.getFileHandler().getProfiles().size())
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -144,6 +144,14 @@ public class AdvancedServerList{
|
||||
getPluginLogger().info("Loading cache.data...");
|
||||
getPlayerHandler().load();
|
||||
|
||||
getPluginLogger().info("Loading Metrics for bStats...");
|
||||
if(getFileHandler().getBoolean("send_statistics")){
|
||||
plugin.loadMetrics();
|
||||
getPluginLogger().info("Metrics loaded!");
|
||||
}else{
|
||||
getPluginLogger().info("'send_statistics' disabled in config.yml. Not loading Metrics for bStats...");
|
||||
}
|
||||
|
||||
getPluginLogger().info("AdvancedServerList is ready!");
|
||||
}
|
||||
|
||||
|
||||
@@ -153,4 +153,8 @@ public class FileHandler{
|
||||
public String getString(String def, Object... path){
|
||||
return node.node(path).getString(def);
|
||||
}
|
||||
|
||||
public boolean getBoolean(Object... path){
|
||||
return node.node(path).getBoolean(true);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
#
|
||||
# Used for when AdvancedServerList doesn't have a cached player to use for ${player name}
|
||||
#
|
||||
unknown_player: "Anonymous"
|
||||
unknown_player: "Anonymous"
|
||||
#
|
||||
# Whether statistics should be sent to bStats or not.
|
||||
#
|
||||
send_statistics: true
|
||||
@@ -33,6 +33,7 @@ import ch.andre601.advancedserverlist.paper.events.JoinEvent;
|
||||
import ch.andre601.advancedserverlist.paper.events.PingEvent;
|
||||
import ch.andre601.advancedserverlist.paper.logging.PaperLogger;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -71,7 +72,9 @@ public class PaperCore extends JavaPlugin implements PluginCore{
|
||||
|
||||
@Override
|
||||
public void loadMetrics(){
|
||||
new Metrics(this, 15584);
|
||||
new Metrics(this, 15584).addCustomChart(new SimplePie("profiles",
|
||||
() -> String.valueOf(core.getFileHandler().getProfiles().size())
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<plugin.version>1.0.1</plugin.version>
|
||||
<plugin.version>1.0.2</plugin.version>
|
||||
<plugin.description>Create multiple Server lists based on conditions.</plugin.description>
|
||||
|
||||
<plugin.depend.mc>1.19-R0.1-SNAPSHOT</plugin.depend.mc>
|
||||
|
||||
@@ -34,6 +34,7 @@ import ch.andre601.advancedserverlist.spigot.logging.SpigotLogger;
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.ProtocolManager;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -87,7 +88,9 @@ public class SpigotCore extends JavaPlugin implements PluginCore{
|
||||
|
||||
@Override
|
||||
public void loadMetrics(){
|
||||
new Metrics(this, 15584);
|
||||
new Metrics(this, 15584).addCustomChart(new SimplePie("profiles",
|
||||
() -> String.valueOf(core.getFileHandler().getProfiles().size())
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
|
||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bstats.velocity.Metrics;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -90,7 +91,9 @@ public class VelocityCore implements PluginCore{
|
||||
|
||||
@Override
|
||||
public void loadMetrics(){
|
||||
metrics.make(this, 15587);
|
||||
metrics.make(this, 15587).addCustomChart(new SimplePie("profiles",
|
||||
() -> String.valueOf(core.getFileHandler().getProfiles().size())
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user