mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Fixes #307
This commit is contained in:
parent
b8a3395d1d
commit
94fa119813
@ -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>
|
||||
|
@ -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()) {
|
||||
C c = C.valueOf(key.toUpperCase());
|
||||
conf.set("locale." + c.getCat() + "." + key, this.map.get(key));
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user