Skip to content

Commit

Permalink
Fix forwards compatibility config issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SparklingComet committed Jan 24, 2021
1 parent 704804d commit 18d1255
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.shanerx.backup</groupId>
<artifactId>AutoBackup</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<description>Schedule and perform automatic backups</description>

<properties>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/shanerx/backup/AutoBackup.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void onEnable() {

getCommand("autobackup").setExecutor(new BackupCommand(this));

if (getConfig().getBoolean("updater")) {
if (!getConfig().getBoolean("disable-updater")) {
new Updater(getDescription()).checkCurrentVersion();
}

Expand All @@ -59,10 +59,14 @@ public void onEnable() {
@Override
public void onDisable() {
getServer().getScheduler().cancelTasks(this);

}

public void loadSettings() {
saveDefaultConfig();
getConfig().options().copyDefaults(true);
//reloadConfig();
//saveConfig();

root = getConfig().getBoolean("relative-paths") ? new File(new File(getDataFolder().getAbsoluteFile().getParent()).getParent()) : null;
backupsDir = new File(root, getConfig().getString("backup-dir"));
Expand Down
14 changes: 7 additions & 7 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

# +------------- Start of Config -------------+

# Enable plugin version checking system. This will alert you when there is a new update.
# Disable plugin version checking system. This will alert you when there is a new update.
# Since new updates may introduce more features and bug patches, it is recommended that you
# keep this enabled (true).
updater: true
# keep the updater enabled (disable-updater: false).
disable-updater: false

# Determines which kind of backup to perform on default, aka when the command /backup is run.
default-modes: ['overworld', 'nether', 'end']
Expand Down Expand Up @@ -51,13 +51,13 @@ allow-force-console: true
# Use this configuration section to determine what is backed up.
# Every list entry is a different backup mode. Feel free to add your own modes and remove the examples
# you don't need.
# - The mode name (example: everything, plugin-jars, etc) can be chosen freely. Avoid using 'default' though.
# - The mode name (example: everything, plugins, etc) can be chosen freely. Avoid using 'default' though.
# - The dir option determines what folder is backed up. '/' means server root.
# - The allow-manual option determines whether this backup can be performed by the /backup command
# - The schedule option determines whether or not to perform the backup manually every x minutes.
# If set to 0 or negative, the scheduled backup is disabled.
# - The schedule option determines whether or not to perform the backup automatically every x minutes.
# If set to 0 or a negative integer, the scheduled backup is disabled.
# If set to a positive integer, the value indicates the time in minutes between every automatic backup.
# NOTE: These are just examples! You should add and tweak the ones you need and get rid of those you
# NOTE: These are just (working) examples! You should add and tweak the ones you need and get rid of those you
# do not need. In particular, the backup 'everything' is extremely inefficient and can take very long times. It
# is therefore highly discouraged. You should rather setup separate smaller backups, ie. one for plugin data, one for
# each world, etc.
Expand Down

0 comments on commit 18d1255

Please sign in to comment.