Remove the Bukkit legacy data folder migration code from 11 years ago (#2383)

(cherry picked from commit EngineHub/WorldEdit@7f81aad028)
This commit is contained in:
Maddy Miller 2023-08-09 18:32:37 -04:00 committed by Matt
parent acb79469fb
commit a088e6a96b

View File

@ -25,7 +25,6 @@ import com.sk89q.worldedit.util.YAMLConfiguration;
import com.sk89q.worldedit.util.report.Unreported; import com.sk89q.worldedit.util.report.Unreported;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import java.io.File;
import java.nio.file.Path; import java.nio.file.Path;
/** /**
@ -53,26 +52,6 @@ public class BukkitConfiguration extends YAMLConfiguration {
WorldEdit.logger.warn("Editing without a Bukkit adapter has been enabled. You will not receive support " WorldEdit.logger.warn("Editing without a Bukkit adapter has been enabled. You will not receive support "
+ "for any issues that arise as a result."); + "for any issues that arise as a result.");
} }
migrateLegacyFolders();
}
private void migrateLegacyFolders() {
migrate(scriptsDir, "craftscripts");
migrate(saveDir, "schematics");
migrate("drawings", "draw.js images");
}
private void migrate(String file, String name) {
File fromDir = new File(".", file);
File toDir = new File(getWorkingDirectoryPath().toFile(), file);
if (fromDir.exists() & !toDir.exists()) {
if (fromDir.renameTo(toDir)) {
plugin.getLogger().info("Migrated " + name + " folder '" + file
+ "' from server root to plugin data folder.");
} else {
plugin.getLogger().warning("Error while migrating " + name + " folder!");
}
}
} }
@Override @Override