Skip to content

Commit

Permalink
Fix mv dumps unable to get latest.log if world-container is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
benwoo1110 committed Jan 16, 2025
1 parent 3a9eb88 commit 5b97c3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void run() {
*/
private String getLogs() {
// Get the Path of latest.log
Path logsPath = plugin.getServer().getWorldContainer().toPath().resolve("logs").resolve("latest.log");
Path logsPath = fileUtils.getServerFolder().toPath().resolve("logs/latest.log");
File logsFile = logsPath.toFile();

if (!logsFile.exists()) {
Expand Down Expand Up @@ -194,24 +194,24 @@ private void addDebugInfoToEvent(MVDumpsDebugInfoEvent event) {

// add config.yml
File configFile = new File(plugin.getDataFolder(), "config.yml");
event.putDetailedDebugInfo("multiverse-core/config.yml", configFile);
event.putDetailedDebugInfo("Multiverse-Core/config.yml", configFile);

// add worlds.yml
File worldsFile = new File(plugin.getDataFolder(), "worlds.yml");
event.putDetailedDebugInfo("multiverse-core/worlds.yml", worldsFile);
event.putDetailedDebugInfo("Multiverse-Core/worlds.yml", worldsFile);

// Add bukkit.yml if we found it
if (fileUtils.getBukkitConfig() != null) {
event.putDetailedDebugInfo(fileUtils.getBukkitConfig().getPath(), fileUtils.getBukkitConfig());
} else {
Logging.warning("/mv version could not find bukkit.yml. Not including file");
Logging.warning("/mv dumps could not find bukkit.yml. Not including file");
}

// Add server.properties if we found it
if (fileUtils.getServerProperties() != null) {
event.putDetailedDebugInfo(fileUtils.getServerProperties().getPath(), fileUtils.getServerProperties());
} else {
Logging.warning("/mv version could not find server.properties. Not including file");
Logging.warning("/mv dumps could not find server.properties. Not including file");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public class FileUtils {

@Inject
protected FileUtils(@NotNull MultiverseCore plugin) {
this.serverFolder = getServerFolder(plugin);
this.serverFolder = getServerFolder();
Logging.fine("Server folder: " + this.serverFolder);
this.bukkitYml = findFileFromServerDirectory("bukkit.yml");
this.serverProperties = findFileFromServerDirectory("server.properties");
}

private File getServerFolder(@NotNull Plugin plugin) {
public File getServerFolder() {
return new File(System.getProperty("user.dir"));
}

Expand Down

0 comments on commit 5b97c3f

Please sign in to comment.