mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:58:35 +00:00
Copy paste/merge FAWE classes to this WorldEdit fork
- so certain people can look at the diff and complain about my sloppy code :( Signed-off-by: Jesse Boyd <jessepaleg@gmail.com>
This commit is contained in:
@ -23,13 +23,12 @@ import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.Vector2D;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Represents a configuration node.
|
||||
*/
|
||||
|
@ -23,18 +23,11 @@ import com.sk89q.util.StringUtil;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import org.yaml.snakeyaml.emitter.ScalarAnalysis;
|
||||
import org.yaml.snakeyaml.nodes.Tag;
|
||||
import org.yaml.snakeyaml.reader.UnicodeReader;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@ -298,16 +291,15 @@ public class YAMLProcessor extends YAMLNode {
|
||||
|
||||
// This will be included in snakeyaml 1.10, but until then we have to do it manually.
|
||||
private class FancyDumperOptions extends DumperOptions {
|
||||
@Override
|
||||
public DumperOptions.ScalarStyle calculateScalarStyle(ScalarAnalysis analysis,
|
||||
DumperOptions.ScalarStyle style) {
|
||||
if (format == YAMLFormat.EXTENDED
|
||||
&& (analysis.scalar.contains("\n") || analysis.scalar.contains("\r"))) {
|
||||
return ScalarStyle.LITERAL;
|
||||
} else {
|
||||
return super.calculateScalarStyle(analysis, style);
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// public DumperOptions.ScalarStyle calculateScalarStyle(ScalarAnalysis analysis,
|
||||
// DumperOptions.ScalarStyle style) {
|
||||
// if (format == YAMLFormat.EXTENDED && (analysis.scalar.contains("\n") || analysis.scalar.contains("\r"))) {
|
||||
// return ScalarStyle.LITERAL;
|
||||
// } else {
|
||||
// return super.calculateScalarStyle(analysis, style);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private static class FancyRepresenter extends Representer {
|
||||
@ -315,5 +307,4 @@ public class YAMLProcessor extends YAMLNode {
|
||||
this.nullRepresenter = o -> representScalar(Tag.NULL, "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user