Changes migrator to ensure old-style configuration is used during migration
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				KnarCraft/KnarLib/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	KnarCraft/KnarLib/pipeline/head This commit looks good
				
			This commit is contained in:
		@@ -75,7 +75,15 @@ public final class ConfigHelper {
 | 
			
		||||
 | 
			
		||||
        //Load old and new configuration
 | 
			
		||||
        plugin.reloadConfig();
 | 
			
		||||
        FileConfiguration oldConfiguration = plugin.getConfig();
 | 
			
		||||
        FileConfiguration oldConfiguration;
 | 
			
		||||
        try {
 | 
			
		||||
            oldConfiguration = new YamlConfiguration();
 | 
			
		||||
            oldConfiguration.load(new File(dataFolder, CONFIG_FILE));
 | 
			
		||||
        } catch (IOException | InvalidConfigurationException exception) {
 | 
			
		||||
            plugin.getLogger().log(Level.WARNING, "Unable to load old configuration and do migration");
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        InputStream configStream = FileHelper.getInputStreamForInternalFile("/" + CONFIG_FILE);
 | 
			
		||||
        if (configStream == null) {
 | 
			
		||||
            plugin.getLogger().log(Level.SEVERE, "Could not migrate the configuration, as the internal " +
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user