mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Add tuinity.yml and server.properties to timings config tab
This commit is contained in:
@@ -1,25 +1,78 @@
|
||||
From 2cab1732fb9596bf2c2b692f3f018dd51609596f Mon Sep 17 00:00:00 2001
|
||||
From 3c223fc899501579d3656f7e73da79b195c59f39 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Tue, 18 Feb 2020 20:30:03 -0600
|
||||
Subject: [PATCH] Purpur config files
|
||||
|
||||
---
|
||||
src/main/java/org/bukkit/Server.java | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
.../java/co/aikar/timings/TimingsExport.java | 24 ++++++++++++++++---
|
||||
src/main/java/org/bukkit/Server.java | 17 +++++++++++++
|
||||
2 files changed, 38 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 93d5a3f97..b5111928d 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -204,9 +204,14 @@ class TimingsExport extends Thread {
|
||||
// Information on the users Config
|
||||
|
||||
parent.put("config", createObject(
|
||||
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null))
|
||||
+ // Purpur start
|
||||
+ pair("server.properties", mapAsJSON(Bukkit.spigot().getServerProperties())),
|
||||
+ pair("bukkit.yml", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
+ pair("spigot.yml", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
|
||||
+ pair("paper.yml", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
|
||||
+ pair("tuinity.yml", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)),
|
||||
+ pair("purpur.yml", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
|
||||
+ // Purpur end
|
||||
));
|
||||
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
@@ -247,6 +252,19 @@ class TimingsExport extends Thread {
|
||||
return timingsCost;
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ private static JSONObject mapAsJSON(java.util.Properties properties) {
|
||||
+ JSONObject object = new JSONObject();
|
||||
+ for (String key : properties.stringPropertyNames()) {
|
||||
+ if (TimingsManager.hiddenConfigs.contains(key)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ object.put(key, valAsJSON(properties.get(key), key));
|
||||
+ }
|
||||
+ return object;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index 98e7ba900..765f8059a 100644
|
||||
index 98e7ba900..bea600c65 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1331,6 +1331,13 @@ public interface Server extends PluginMessageRecipient {
|
||||
@@ -1331,6 +1331,23 @@ public interface Server extends PluginMessageRecipient {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Purpur start
|
||||
+ @NotNull
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getTuinityConfig() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public org.bukkit.configuration.file.YamlConfiguration getPurpurConfig() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public java.util.Properties getServerProperties() {
|
||||
+ throw new UnsupportedOperationException("Not supported yet.");
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user