Rename MVDumpsDebugInfoEvent methods to reflect the class name change

This commit is contained in:
Ben Woo 2024-11-24 13:26:22 +08:00
parent 8d852c5269
commit d0774614c8
2 changed files with 23 additions and 23 deletions

View File

@ -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<String, String> files = versionEvent.getDetailedVersionInfo();
final Map<String, String> 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");
}

View File

@ -18,12 +18,12 @@ import org.bukkit.event.HandlerList;
*/
public class MVDumpsDebugInfoEvent extends Event {
private final StringBuilder versionInfoBuilder;
private final Map<String, String> detailedVersionInfo;
private final StringBuilder debugInfoBuilder;
private final Map<String, String> 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<String, String> getDetailedVersionInfo() {
return Collections.unmodifiableMap(this.detailedVersionInfo);
public Map<String, String> 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()));
}
}