mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-25 17:41:50 +01:00
Append OnlineMode server information to ServerReport (#1891)
This commit is contained in:
parent
271b32aa1d
commit
b698941378
@ -20,6 +20,7 @@
|
|||||||
package com.sk89q.worldguard.bukkit.util.report;
|
package com.sk89q.worldguard.bukkit.util.report;
|
||||||
|
|
||||||
import com.sk89q.worldedit.util.report.DataReport;
|
import com.sk89q.worldedit.util.report.DataReport;
|
||||||
|
import io.papermc.lib.PaperLib;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
|
|
||||||
@ -33,9 +34,18 @@ public ServerReport() {
|
|||||||
append("Bukkit Version", server.getBukkitVersion());
|
append("Bukkit Version", server.getBukkitVersion());
|
||||||
append("Implementation", server.getName() + " " + server.getVersion());
|
append("Implementation", server.getName() + " " + server.getVersion());
|
||||||
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());
|
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());
|
||||||
|
|
||||||
append("Server Class Source", server.getClass().getProtectionDomain().getCodeSource().getLocation());
|
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");
|
DataReport spawning = new DataReport("Spawning");
|
||||||
spawning.append("Ambient Spawn Limit", server.getAmbientSpawnLimit());
|
spawning.append("Ambient Spawn Limit", server.getAmbientSpawnLimit());
|
||||||
spawning.append("Animal Spawn Limit", server.getAnimalSpawnLimit());
|
spawning.append("Animal Spawn Limit", server.getAnimalSpawnLimit());
|
||||||
|
Loading…
Reference in New Issue
Block a user