diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java index 5480f8b9..4ebb1ecf 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java @@ -145,26 +145,40 @@ public static String getArg(List tags, String arg) { public static void importConfig(ConfigRepository configRepo) { var config = new Config(); ConfigAccessor configOldAccessor = new ConfigAccessor( - AdvancedPortalsPlugin.getInstance(), "config.yml"); + AdvancedPortalsPlugin.getInstance(), "config.yml"); var configOld = configOldAccessor.getConfig(); - config.useOnlySpecialAxe = configOld.getBoolean("UseOnlyServerMadeAxe", config.useOnlySpecialAxe); - config.blockSpectatorMode = configOld.getBoolean("BlockSpectatorMode", config.blockSpectatorMode); - config.selectorMaterial = configOld.getString("AxeItemId", config.selectorMaterial); - config.portalProtection = configOld.getBoolean("PortalProtection", config.portalProtection); - config.portalProtectionRaduis = configOld.getInt("PortalProtectionArea", config.portalProtectionRaduis); - config.defaultTriggerBlock = configOld.getString("DefaultPortalTriggerBlock", config.defaultTriggerBlock); + config.useOnlySpecialAxe = configOld.getBoolean( + "UseOnlyServerMadeAxe", config.useOnlySpecialAxe); + config.blockSpectatorMode = configOld.getBoolean( + "BlockSpectatorMode", config.blockSpectatorMode); + config.selectorMaterial = + configOld.getString("AxeItemId", config.selectorMaterial); + config.portalProtection = + configOld.getBoolean("PortalProtection", config.portalProtection); + config.portalProtectionRaduis = configOld.getInt( + "PortalProtectionArea", config.portalProtectionRaduis); + config.defaultTriggerBlock = configOld.getString( + "DefaultPortalTriggerBlock", config.defaultTriggerBlock); if (config.defaultTriggerBlock.equals("PORTAL")) { config.defaultTriggerBlock = "NETHER_PORTAL"; } - config.stopWaterFlow = configOld.getBoolean("StopWaterFlow", config.stopWaterFlow); - config.joinCooldown = configOld.getInt("PortalCooldown", config.joinCooldown); - config.throwbackStrength = configOld.getDouble("ThrowbackAmount", config.throwbackStrength); - config.playFailSound = configOld.getBoolean("PlayFailSound", config.playFailSound); - config.warpMessageOnActionBar = configOld.getInt("WarpMessageDisplay", 2) == 2; - config.warpMessageInChat = configOld.getInt("WarpMessageDisplay", 2) == 1; - config.enableProxySupport = configOld.getBoolean("ForceEnableProxySupport", config.enableProxySupport); - config.disableGatewayBeam = configOld.getBoolean("DisableGatewayBeam", config.disableGatewayBeam); + config.stopWaterFlow = + configOld.getBoolean("StopWaterFlow", config.stopWaterFlow); + config.joinCooldown = + configOld.getInt("PortalCooldown", config.joinCooldown); + config.throwbackStrength = + configOld.getDouble("ThrowbackAmount", config.throwbackStrength); + config.playFailSound = + configOld.getBoolean("PlayFailSound", config.playFailSound); + config.warpMessageOnActionBar = + configOld.getInt("WarpMessageDisplay", 2) == 2; + config.warpMessageInChat = + configOld.getInt("WarpMessageDisplay", 2) == 1; + config.enableProxySupport = configOld.getBoolean( + "ForceEnableProxySupport", config.enableProxySupport); + config.disableGatewayBeam = configOld.getBoolean( + "DisableGatewayBeam", config.disableGatewayBeam); CommandPortalConfig commandConfig = new CommandPortalConfig(); var commandString = configOld.getString("CommandLevels", "opcb"); @@ -177,8 +191,10 @@ public static void importConfig(ConfigRepository configRepo) { config.commandPortals = commandConfig; WarpEffectConfig warpEffectConfig = new WarpEffectConfig(); - warpEffectConfig.visualEffect = configOld.getInt("WarpParticles", 1) == 1 ? "ender" : null; - warpEffectConfig.soundEffect = configOld.getInt("WarpSound", 1) == 1 ? "ender" : null; + warpEffectConfig.visualEffect = + configOld.getInt("WarpParticles", 1) == 1 ? "ender" : null; + warpEffectConfig.soundEffect = + configOld.getInt("WarpSound", 1) == 1 ? "ender" : null; config.warpEffect = warpEffectConfig; configRepo.importConfig(config);