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> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<artifactId>PlotSquared</artifactId> <artifactId>PlotSquared</artifactId>
<version>2.10.8</version> <version>2.10.9</version>
<name>PlotSquared</name> <name>PlotSquared</name>
<packaging>jar</packaging> <packaging>jar</packaging>
<build> <build>

View File

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