This commit is contained in:
boy0001 2015-05-13 13:05:32 +10:00
parent b8a3395d1d
commit 94fa119813
2 changed files with 11 additions and 9 deletions

View File

@ -8,7 +8,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<artifactId>PlotSquared</artifactId>
<version>2.10.8</version>
<version>2.10.9</version>
<name>PlotSquared</name>
<packaging>jar</packaging>
<build>

View File

@ -9,13 +9,12 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C;
import org.bukkit.configuration.file.YamlConfiguration;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import com.intellectualcrafters.plot.config.C;
/**
* The YAML implementation of TranslationFile Relies heavily on SnakeYAML
*
@ -146,8 +145,11 @@ public class YamlTranslationFile extends TranslationFile {
if (this.isC()) {
YamlConfiguration conf = YamlConfiguration.loadConfiguration(this.file);
for (String key : this.map.keySet()) {
try {
C c = C.valueOf(key.toUpperCase());
conf.set("locale." + c.getCat() + "." + key, this.map.get(key));
}
catch (IllegalArgumentException e) {}
conf.set(key, null);
}
try {
@ -222,7 +224,7 @@ public class YamlTranslationFile extends TranslationFile {
YamlConfiguration conf = YamlConfiguration.loadConfiguration(this.file);
if (conf.get("locale") == null) {
try {
this.map = (HashMap<String, String>) getYaml().load(new FileReader(this.file));
this.map = (HashMap<String, String>) this.getYaml().load(new FileReader(this.file));
} catch (final Exception e) {
e.printStackTrace();
}
@ -249,7 +251,7 @@ public class YamlTranslationFile extends TranslationFile {
}
} else {
try {
this.map = (HashMap<String, String>) getYaml().load(new FileReader(this.file));
this.map = (HashMap<String, String>) this.getYaml().load(new FileReader(this.file));
} catch (final Exception e) {
e.printStackTrace();
}
@ -266,7 +268,7 @@ public class YamlTranslationFile extends TranslationFile {
}
public boolean isC() {
return isC;
return this.isC;
}
public void setIsC(boolean isC) {