mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
@@ -1,7 +1,5 @@
|
||||
package org.bukkit.configuration;
|
||||
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
|
@@ -56,7 +56,6 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
|
||||
* but you may include one if you wish for extra spacing.
|
||||
* <p>
|
||||
* Null is a valid value which will indicate that no header is to be applied.
|
||||
*
|
||||
*
|
||||
* @param value New header
|
||||
* @return This object, for chaining
|
||||
|
@@ -12,11 +12,8 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.Configuration;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.constructor.SafeConstructor;
|
||||
import org.yaml.snakeyaml.error.YAMLException;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
|
@@ -17,6 +17,7 @@ public class YamlConstructor extends SafeConstructor {
|
||||
}
|
||||
|
||||
private class ConstructCustomObject extends ConstructYamlMap {
|
||||
@Override
|
||||
public Object construct(Node node) {
|
||||
if (node.isTwoStepsConstruction()) {
|
||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||
@@ -40,6 +41,7 @@ public class YamlConstructor extends SafeConstructor {
|
||||
return raw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void construct2ndStep(Node node, Object object) {
|
||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||
}
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.configuration.file;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -9,7 +8,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
||||
|
||||
import org.yaml.snakeyaml.nodes.Node;
|
||||
import org.yaml.snakeyaml.representer.Represent;
|
||||
import org.yaml.snakeyaml.representer.Representer;
|
||||
|
||||
public class YamlRepresenter extends Representer {
|
||||
@@ -20,6 +18,7 @@ public class YamlRepresenter extends Representer {
|
||||
}
|
||||
|
||||
private class RepresentConfigurationSection extends RepresentMap {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Node representData(Object data) {
|
||||
return super.representData(((ConfigurationSection) data).getValues(false));
|
||||
@@ -27,6 +26,7 @@ public class YamlRepresenter extends Representer {
|
||||
}
|
||||
|
||||
private class RepresentConfigurationSerializable extends RepresentMap {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Node representData(Object data) {
|
||||
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
||||
|
Reference in New Issue
Block a user