The /backupnow command now uses the backupWorldsAsync method instead of directly calling backupWorlds.
Users receive a message indicating that the backup is starting asynchronously, and the server can continue running without delays caused by the backup process.
Updated /backupnow Block:
Code (YAML):
if
(command.getName
().equalsIgnoreCase
("backupnow")){ if
(!sender.hasPermission
("backupplugin.backupnow")){ sender.sendMessage
("You don't have permission to use this command.");
return true;
} sender.sendMessage
("Starting manual backup asynchronously...");
backupWorldsAsync
("ManualSave");
return true;
}
3. Preserved the Original Functionality
The original backupWorlds method remains unchanged, as it is called internally by the new asynchronous method
1.
Added support for a configurable list of ignored directories: A new key, ignored-directories, was introduced in config.yml.
This key contains a list of directory names that should be skipped during the backup process.
2.
Updated the zipFolder method: Before processing each directory or file, the method checks if the directory name matches any entry in the ignored-directories list.
Result: Administrators can easily add or remove directories to be ignored via the configuration file.
The default ignored directories are:
advancements
playerdata
stats