mirror of
https://codeberg.org/Andre601/AdvancedServerList.git
synced 2026-11-05 09:00:15 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3851fa5f67 | ||
|
|
2b92257523 | ||
|
|
d64ab46643 |
No files matched your search
@@ -1,6 +1,8 @@
|
||||
[placeholders]: https://github.com/Andre601/AdvancedServerList/wiki/Profiles#placeholders
|
||||
[wiki]: https://github.com/Andre601/AdvancedServerList/wiki
|
||||
|
||||
[spigot]: https://www.spigotmc.org/resources/102910/
|
||||
|
||||
[stats-spigot]: https://bstats.org/plugin/bukkit/AdvancedServerList/15584
|
||||
[stats-bungeecord]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
|
||||
[stats-velocity]: https://bstats.org/plugin/velocity/AdvancedServerList/15587
|
||||
@@ -34,10 +36,10 @@ Other platform may be supported, but compatability has not been tested with any
|
||||
|
||||
## Links
|
||||
|
||||
- SpigotMC (TODO)
|
||||
- [SpigotMC][spigot]
|
||||
- [Wiki][wiki]
|
||||
- Statistics
|
||||
- [Spigot/PaperMC][stats-spigot]
|
||||
- [BungeeCord][stats-bungeecord]
|
||||
- [Velocity][stats-velocity]
|
||||
- [License][license]
|
||||
- [License][license]
|
||||
+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);
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -28,6 +28,7 @@ package ch.andre601.advancedserverlist.core.profiles;
|
||||
import org.spongepowered.configurate.ConfigurationNode;
|
||||
import org.spongepowered.configurate.serialize.SerializationException;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ServerListProfile{
|
||||
@@ -73,11 +74,11 @@ public class ServerListProfile{
|
||||
try{
|
||||
list = node.node(key).getList(String.class);
|
||||
}catch(SerializationException ex){
|
||||
return null;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
if(list == null)
|
||||
return null;
|
||||
return Collections.emptyList();
|
||||
|
||||
if(trim && list.size() > 2)
|
||||
return list.subList(0, 2);
|
||||
|
||||
@@ -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.0</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