From d0774614c846cb3d040c88cf0113c187862e3f85 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:26:22 +0800 Subject: [PATCH] Rename MVDumpsDebugInfoEvent methods to reflect the class name change --- .../core/commands/DumpsCommand.java | 18 ++++++------ .../core/event/MVDumpsDebugInfoEvent.java | 28 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/DumpsCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/DumpsCommand.java index 66321135..e1cd1916 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/DumpsCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/DumpsCommand.java @@ -105,7 +105,7 @@ class DumpsCommand extends CoreCommand { // Add plugin list if user isn't paranoid if (!paranoid) { - versionEvent.putDetailedVersionInfo("plugins.md", "# Plugins\n\n" + getPluginList()); + versionEvent.putDetailedDebugInfo("plugins.md", "# Plugins\n\n" + getPluginList()); } BukkitRunnable logPoster = new BukkitRunnable() { @@ -121,12 +121,12 @@ class DumpsCommand extends CoreCommand { case MCLOGS -> issuer.sendInfo(MVCorei18n.DUMPS_URL_LIST, "{service}", "Logs", "{link}", postToService(PasteServiceType.MCLOGS, true, getLogs(), null)); - case APPEND -> versionEvent.putDetailedVersionInfo("latest.log", getLogs()); + case APPEND -> versionEvent.putDetailedDebugInfo("latest.log", getLogs()); } } // Get the files from the event - final Map files = versionEvent.getDetailedVersionInfo(); + final Map files = versionEvent.getDetailedDebugInfo(); // Deal with uploading debug info switch (servicesType) { @@ -179,7 +179,7 @@ class DumpsCommand extends CoreCommand { return "Could not read log"; } - private String getVersionString() { + private String getDebugInfoString() { return "# Multiverse-Core Version info" + "\n\n" + " - Multiverse-Core Version: " + this.plugin.getDescription().getVersion() + '\n' + " - Bukkit Version: " + this.plugin.getServer().getVersion() + '\n' @@ -189,26 +189,26 @@ class DumpsCommand extends CoreCommand { private void addDebugInfoToEvent(MVDumpsDebugInfoEvent event) { // Add the legacy file, but as markdown, so it's readable - event.putDetailedVersionInfo("version.md", this.getVersionString()); + event.putDetailedDebugInfo("version.md", this.getDebugInfoString()); // add config.yml File configFile = new File(plugin.getDataFolder(), "config.yml"); - event.putDetailedVersionInfo("multiverse-core/config.yml", configFile); + event.putDetailedDebugInfo("multiverse-core/config.yml", configFile); // add worlds.yml File worldsFile = new File(plugin.getDataFolder(), "worlds.yml"); - event.putDetailedVersionInfo("multiverse-core/worlds.yml", worldsFile); + event.putDetailedDebugInfo("multiverse-core/worlds.yml", worldsFile); // Add bukkit.yml if we found it if (getBukkitConfig() != null) { - event.putDetailedVersionInfo(getBukkitConfig().getPath(), getBukkitConfig()); + event.putDetailedDebugInfo(getBukkitConfig().getPath(), getBukkitConfig()); } else { Logging.warning("/mv version could not find bukkit.yml. Not including file"); } // Add server.properties if we found it if (getServerProperties() != null) { - event.putDetailedVersionInfo(getServerProperties().getPath(), getServerProperties()); + event.putDetailedDebugInfo(getServerProperties().getPath(), getServerProperties()); } else { Logging.warning("/mv version could not find server.properties. Not including file"); } diff --git a/src/main/java/org/mvplugins/multiverse/core/event/MVDumpsDebugInfoEvent.java b/src/main/java/org/mvplugins/multiverse/core/event/MVDumpsDebugInfoEvent.java index e7608d31..87620850 100644 --- a/src/main/java/org/mvplugins/multiverse/core/event/MVDumpsDebugInfoEvent.java +++ b/src/main/java/org/mvplugins/multiverse/core/event/MVDumpsDebugInfoEvent.java @@ -18,12 +18,12 @@ import org.bukkit.event.HandlerList; */ public class MVDumpsDebugInfoEvent extends Event { - private final StringBuilder versionInfoBuilder; - private final Map detailedVersionInfo; + private final StringBuilder debugInfoBuilder; + private final Map detailedDebugInfo; public MVDumpsDebugInfoEvent() { - versionInfoBuilder = new StringBuilder(); - detailedVersionInfo = new HashMap<>(); + debugInfoBuilder = new StringBuilder(); + detailedDebugInfo = new HashMap<>(); } private static final HandlerList HANDLERS = new HandlerList(); @@ -48,8 +48,8 @@ public class MVDumpsDebugInfoEvent extends Event { * Gets the version-info currently saved in this event. * @return The version-info. */ - public String getVersionInfo() { - return this.versionInfoBuilder.toString(); + public String getDebugInfo() { + return this.debugInfoBuilder.toString(); } /** @@ -63,16 +63,16 @@ public class MVDumpsDebugInfoEvent extends Event { * * @return The immutable key value mapping of files and the contents of those files. */ - public Map getDetailedVersionInfo() { - return Collections.unmodifiableMap(this.detailedVersionInfo); + public Map getDetailedDebugInfo() { + return Collections.unmodifiableMap(this.detailedDebugInfo); } /** * Appends more version-info to the version-info currently saved in this event. * @param moreVersionInfo The version-info to add. Should end with '\n'. */ - public void appendVersionInfo(String moreVersionInfo) { - this.versionInfoBuilder.append(moreVersionInfo); + public void appendDebugInfo(String moreVersionInfo) { + this.debugInfoBuilder.append(moreVersionInfo); } private String readFile(final String filename) { @@ -104,8 +104,8 @@ public class MVDumpsDebugInfoEvent extends Event { * @param fileName The name of the file. * @param contents The contents of the file. */ - public void putDetailedVersionInfo(String fileName, String contents) { - this.detailedVersionInfo.put(fileName, contents); + public void putDetailedDebugInfo(String fileName, String contents) { + this.detailedDebugInfo.put(fileName, contents); } /** @@ -113,7 +113,7 @@ public class MVDumpsDebugInfoEvent extends Event { * @param filename The name of the file. * @param file The file. */ - public void putDetailedVersionInfo(String filename, File file) { - this.putDetailedVersionInfo(filename, readFile(file.getAbsolutePath())); + public void putDetailedDebugInfo(String filename, File file) { + this.putDetailedDebugInfo(filename, readFile(file.getAbsolutePath())); } }