Skip to content

Commit

Permalink
Remove outdated methods(yaml)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Nov 30, 2020
1 parent 7b5e7a8 commit dd2f764
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ repositories {
maven { url "http://repo.bukkit.org/content/groups/public" }
maven { url "http://maven.sk89q.com/repo/" }
maven { url "http://repo.maven.apache.org/maven2" }
maven { url "https://hub.spigotmc.org/nexus/content/groups/public" }
}

dependencies {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/mohistmc/worldeditfix/WorldEditFix.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.mohistmc.worldeditfix;

import com.sk89q.worldedit.blocks.BlockType;
import java.util.Map;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import org.bukkit.Bukkit;
import org.bukkit.Material;

Expand Down
16 changes: 1 addition & 15 deletions src/main/java/com/sk89q/util/yaml/YAMLProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {
super(new LinkedHashMap<String, Object>(), writeDefaults);
this.format = format;

DumperOptions options = new FancyDumperOptions();
DumperOptions options = new DumperOptions();
options.setIndent(4);
options.setDefaultFlowStyle(format.getStyle());
Representer representer = new FancyRepresenter();
Expand Down Expand Up @@ -305,20 +305,6 @@ public static YAMLNode getEmptyNode(boolean writeDefaults) {
return new YAMLNode(new LinkedHashMap<String, Object>(), writeDefaults);
}

// 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);
}
}
}

private static class FancyRepresenter extends Representer {
private FancyRepresenter() {
this.nullRepresenter = new Represent() {
Expand Down

0 comments on commit dd2f764

Please sign in to comment.