Skip to content


Append OnlineMode server information to ServerReport (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joo200 committed Apr 3, 2022
1 parent 271b32a commit b698941
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
import org.bukkit.Server;

Expand All @@ -33,9 +34,18 @@ public ServerReport() {
append("Bukkit Version", server.getBukkitVersion());
append("Implementation", server.getName() + " " + server.getVersion());
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());

append("Server Class Source", server.getClass().getProtectionDomain().getCodeSource().getLocation());

DataReport onlineMode = new DataReport("Online Mode");
onlineMode.append("enabled?", server.getOnlineMode());
if (PaperLib.isSpigot()) {
onlineMode.append("BungeeCord support?", Bukkit.spigot().getSpigotConfig().getBoolean("settings.bungeecord", false));
if (PaperLib.isPaper()) {
onlineMode.append("Velocity support?", Bukkit.spigot().getPaperConfig().getBoolean("settings.velocity-support.enabled", false));
append(onlineMode.getTitle(), onlineMode);

DataReport spawning = new DataReport("Spawning");
spawning.append("Ambient Spawn Limit", server.getAmbientSpawnLimit());
spawning.append("Animal Spawn Limit", server.getAnimalSpawnLimit());
Expand Down

0 comments on commit b698941

Please sign in to comment.