mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 13:05:41 +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>
|
<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>
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user