fix: ensure config-legacy.yml is created before accessed (#2752)

* fix: ensure config-legacy.yml is created before accessed

* Stop error attempting to load FAWE config if it doesn't exist
This commit is contained in:
Jordan
2024-06-13 20:31:45 +02:00
committed by GitHub
parent 865cc55a0e
commit 031fdf2efd
3 changed files with 8 additions and 4 deletions

View File

@ -137,6 +137,10 @@ public class WorldEditPlugin extends JavaPlugin {
//noinspection ResultOfMethodCallIgnored
getDataFolder().mkdirs();
//FAWE start - Migrate from config-legacy to worldedit-config
migrateLegacyConfig();
//FAWE end
//FAWE start - Modify WorldEdit config name
config = new BukkitConfiguration(new YAMLProcessor(new File(getDataFolder(), "worldedit-config.yml"), true), this);
// Load config before we say we've loaded platforms as it is used in listeners of the event
@ -151,10 +155,6 @@ public class WorldEditPlugin extends JavaPlugin {
platform = new BukkitServerInterface(this, getServer());
worldEdit.getPlatformManager().register(platform);
//FAWE start - Migrate from config-legacy to worldedit-config
migrateLegacyConfig();
//FAWE end
//FAWE start - Setup permission attachments
permissionAttachmentManager = new BukkitPermissionAttachmentManager(this);
//FAWE end