mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
@@ -4,7 +4,6 @@ import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@@ -29,8 +28,6 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
@Override
|
||||
public String saveToString() {
|
||||
Map<String, Object> output = new LinkedHashMap<String, Object>();
|
||||
|
||||
yamlOptions.setIndent(options().indent());
|
||||
yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
|
||||
@@ -45,6 +42,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
return header + dump;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void loadFromString(String contents) throws InvalidConfigurationException {
|
||||
if (contents == null) {
|
||||
@@ -70,6 +68,7 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void convertMapsToSections(Map<Object, Object> input, ConfigurationSection section) {
|
||||
for (Map.Entry<Object, Object> entry : input.entrySet()) {
|
||||
String key = entry.getKey().toString();
|
||||
|
@@ -23,6 +23,7 @@ public class YamlConstructor extends SafeConstructor {
|
||||
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<Object, Object> raw = (Map<Object, Object>) super.construct(node);
|
||||
|
||||
if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) {
|
||||
|
@@ -19,7 +19,6 @@ 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,7 +26,6 @@ public class YamlRepresenter extends Representer {
|
||||
|
||||
private class RepresentConfigurationSerializable extends RepresentMap {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Node representData(Object data) {
|
||||
ConfigurationSerializable serializable = (ConfigurationSerializable) data;
|
||||
Map<String, Object> values = new LinkedHashMap<String, Object>();
|
||||
|
Reference in New Issue
Block a user