mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-02 14:29:07 +01:00
Extra adjustments for job migration
This commit is contained in:
parent
3f16abdc80
commit
3eed42cfaa
@ -70,7 +70,7 @@ public class ConfigManager {
|
||||
|
||||
private final Set<YmlMaker> jobFiles = new HashSet<>();
|
||||
|
||||
public static final String exampleJobName = "exampleJob";
|
||||
public static final String exampleJobName = "_EXAMPLE";
|
||||
|
||||
public ConfigManager() {
|
||||
this.jobFile = new File(Jobs.getFolder(), "jobConfig.yml");
|
||||
@ -627,22 +627,19 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
private boolean migrateJobs() {
|
||||
|
||||
YamlConfiguration oldConf = getJobConfig();
|
||||
if (oldConf == null) {
|
||||
if (jobsPathFolder.exists()) {
|
||||
return false;
|
||||
if (!jobsPathFolder.exists()) {
|
||||
jobsPathFolder.mkdirs();
|
||||
}
|
||||
|
||||
jobsPathFolder.mkdirs();
|
||||
|
||||
if (jobsPathFolder.isDirectory() && jobsPathFolder.listFiles().length == 0)
|
||||
try {
|
||||
for (String f : Util.getFilesFromPackage("Jobs", "", "yml")) {
|
||||
Jobs.getInstance().saveResource("Jobs" + File.separator + f + ".yml", false);
|
||||
for (String f : Util.getFilesFromPackage("jobs", "", "yml")) {
|
||||
Jobs.getInstance().saveResource("jobs" + File.separator + f + ".yml", false);
|
||||
}
|
||||
} catch (Exception c) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ public abstract class JobsDAO {
|
||||
|
||||
conn.commit();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
} finally {
|
||||
close(prestt);
|
||||
close(res2);
|
||||
|
@ -3,6 +3,10 @@
|
||||
# Edited by roracle to include 1.13 items and item names, preparing for 1.14 as well.
|
||||
|
||||
# Must be one word. This job will be ignored as this is just example of all possible actions.
|
||||
|
||||
# ATTENTION!
|
||||
# This is just an example job and will not be included into job list. Recomended to keep it around just for reference. Can be removed if needed.
|
||||
|
||||
exampleJob:
|
||||
# full name of the job (displayed when browsing a job, used when joining and leaving)
|
||||
# also can be used as a prefix for the user's name if the option is enabled.
|
Loading…
Reference in New Issue
Block a user