// Path: 1.13_2.13.45.D3/src/main/java/jdk/internal/joptsimple/internal/Strings.java
// public final class Strings {
//     public static final String EMPTY = "";
//     public static final String LINE_SEPARATOR = getProperty( "line.separator" );
// 
//     private Strings() {
//         throw new UnsupportedOperationException();
//     }
// 
//     /**
//      * Gives a string consisting of the given character repeated the given number of times.
//      *
//      * @param ch the character to repeat
//      * @param count how many times to repeat the character
//      * @return the resultant string
//      */
//     public static String repeat( char ch, int count ) {
//         StringBuilder buffer = new StringBuilder();
// 
//         for ( int i = 0; i < count; ++i )
//             buffer.append( ch );
// 
//         return buffer.toString();
//     }
// 
//     /**
//      * Tells whether the given string is either {@code} or consists solely of whitespace characters.
//      *
//      * @param target string to check
//      * @return {@code true} if the target string is null or empty
//      */
//     public static boolean isNullOrEmpty( String target ) {
//         return target == null || target.isEmpty();
//     }
// 
// 
//     /**
//      * Gives a string consisting of a given string prepended and appended with surrounding characters.
//      *
//      * @param target a string
//      * @param begin character to prepend
//      * @param end character to append
//      * @return the surrounded string
//      */
//     public static String surround( String target, char begin, char end ) {
//         return begin + target + end;
//     }
// 
//     /**
//      * Gives a string consisting of the elements of a given array of strings, each separated by a given separator
//      * string.
//      *
//      * @param pieces the strings to join
//      * @param separator the separator
//      * @return the joined string
//      */
//     public static String join( String[] pieces, String separator ) {
//         return join( asList( pieces ), separator );
//     }
// 
//     /**
//      * Gives a string consisting of the string representations of the elements of a given array of objects,
//      * each separated by a given separator string.
//      *
//      * @param pieces the elements whose string representations are to be joined
//      * @param separator the separator
//      * @return the joined string
//      */
//     public static String join( Iterable<String> pieces, String separator ) {
//         StringBuilder buffer = new StringBuilder();
// 
//         for ( Iterator<String> iter = pieces.iterator(); iter.hasNext(); ) {
//             buffer.append( iter.next() );
// 
//             if ( iter.hasNext() )
//                 buffer.append( separator );
//         }
// 
//         return buffer.toString();
//     }
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import jdk.internal.joptsimple.internal.Strings;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.file.YamlConstructor;
import org.bukkit.configuration.file.YamlRepresenter;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.representer.Representer;
import com.google.common.base.Charsets;

package com.github.joelgodofwar.sps.api;




 
/*
 * @author: Aoife (Josh)
 * @date: 2020-04-25
 * @project: WarpConverter
 */
 
public class YmlConfiguration extends YamlConfiguration {
 
    private final DumperOptions yamlOptions = new DumperOptions();
    private final Representer yamlRepresenter = new YamlRepresenter();
    private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions);
    private Map<Integer, String> commentContainer = new HashMap<>();
 
    public void save(File file) throws IOException {
        Validate.notNull(file);
 
        try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)) {
            writer.write(saveToString());
        }
 
    }
 
    public static void saveConfig(File file, YmlConfiguration config) {
        try {
            config.save(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
 
    @Override
    public String saveToString(){
        yamlOptions.setIndent(options().indent());
        yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
 
        String header = "";//buildHeader();
        String dump = yaml.dump(getValues(false));
 
        if (dump.equals(BLANK_CONFIG)) {

// Path: 1.13_2.13.45.D3/src/main/java/jdk/internal/joptsimple/internal/Strings.java
// public final class Strings {
//     public static final String EMPTY = "";
//     public static final String LINE_SEPARATOR = getProperty( "line.separator" );
// 
//     private Strings() {
//         throw new UnsupportedOperationException();
//     }
// 
//     /**
//      * Gives a string consisting of the given character repeated the given number of times.
//      *
//      * @param ch the character to repeat
//      * @param count how many times to repeat the character
//      * @return the resultant string
//      */
//     public static String repeat( char ch, int count ) {
//         StringBuilder buffer = new StringBuilder();
// 
//         for ( int i = 0; i < count; ++i )
//             buffer.append( ch );
// 
//         return buffer.toString();
//     }
// 
//     /**
//      * Tells whether the given string is either {@code} or consists solely of whitespace characters.
//      *
//      * @param target string to check
//      * @return {@code true} if the target string is null or empty
//      */
//     public static boolean isNullOrEmpty( String target ) {
//         return target == null || target.isEmpty();
//     }
// 
// 
//     /**
//      * Gives a string consisting of a given string prepended and appended with surrounding characters.
//      *
//      * @param target a string
//      * @param begin character to prepend
//      * @param end character to append
//      * @return the surrounded string
//      */
//     public static String surround( String target, char begin, char end ) {
//         return begin + target + end;
//     }
// 
//     /**
//      * Gives a string consisting of the elements of a given array of strings, each separated by a given separator
//      * string.
//      *
//      * @param pieces the strings to join
//      * @param separator the separator
//      * @return the joined string
//      */
//     public static String join( String[] pieces, String separator ) {
//         return join( asList( pieces ), separator );
//     }
// 
//     /**
//      * Gives a string consisting of the string representations of the elements of a given array of objects,
//      * each separated by a given separator string.
//      *
//      * @param pieces the elements whose string representations are to be joined
//      * @param separator the separator
//      * @return the joined string
//      */
//     public static String join( Iterable<String> pieces, String separator ) {
//         StringBuilder buffer = new StringBuilder();
// 
//         for ( Iterator<String> iter = pieces.iterator(); iter.hasNext(); ) {
//             buffer.append( iter.next() );
// 
//             if ( iter.hasNext() )
//                 buffer.append( separator );
//         }
// 
//         return buffer.toString();
//     }
// }


// Path: 1.13_2.13.46/src/com/github/joelgodofwar/sps/api/YmlConfiguration.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import jdk.internal.joptsimple.internal.Strings;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.file.YamlConstructor;
import org.bukkit.configuration.file.YamlRepresenter;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.representer.Representer;
import com.google.common.base.Charsets;

package com.github.joelgodofwar.sps.api;




 
/*
 * @author: Aoife (Josh)
 * @date: 2020-04-25
 * @project: WarpConverter
 */
 
public class YmlConfiguration extends YamlConfiguration {
 
    private final DumperOptions yamlOptions = new DumperOptions();
    private final Representer yamlRepresenter = new YamlRepresenter();
    private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions);
    private Map<Integer, String> commentContainer = new HashMap<>();
 
    public void save(File file) throws IOException {
        Validate.notNull(file);
 
        try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), Charsets.UTF_8)) {
            writer.write(saveToString());
        }
 
    }
 
    public static void saveConfig(File file, YmlConfiguration config) {
        try {
            config.save(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
 
    @Override
    public String saveToString(){
        yamlOptions.setIndent(options().indent());
        yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
 
        String header = "";//buildHeader();
        String dump = yaml.dump(getValues(false));
 
        if (dump.equals(BLANK_CONFIG)) {

            dump = Strings.EMPTY;
