Add a fix for #42 that doesn't involve deleting the configuration files

Also add link default language.yml to the readme.
This commit is contained in:
SeanOMik 2021-06-23 19:21:59 -04:00
parent d94907128f
commit 01efec4092
No known key found for this signature in database
GPG Key ID: CA09E5BE1F32728A
2 changed files with 10 additions and 3 deletions

View File

@ -9,10 +9,13 @@ SpigotMC Plugin that gives you the ability to tame foxes!
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
```
### <a href="https://github.com/SeanOMik/TamableFoxes/blob/master/Plugin/src/main/resources/config.yml">Default Config</a>
### Default configurations:
* <a href="https://github.com/SeanOMik/TamableFoxes/blob/master/Plugin/src/main/resources/config.yml">Default config.yml</a>
* <a href="https://github.com/SeanOMik/TamableFoxes/blob/master/Plugin/src/main/resources/language.yml">Default language.yml</a>
<br>
If you get any errors, <a href="https://github.com/SeanOMik/TamableFoxes/issues/new">create an issue!</a><br><br>
Have you ever wanted to tame foxes? Well, now you can! Use chicken to tame and sweet berries to breed them!<br><br>
### Features:

View File

@ -79,7 +79,11 @@ public class LanguageConfig extends YamlConfiguration {
@Override
public String getString(String path) {
// Only attempt to translate if the text is not empty.
return (super.getString(path).isEmpty()) ? super.getString(path) : ChatColor.translateAlternateColorCodes('&', super.getString(path));
if (contains(path)) {
return (super.getString(path).isEmpty()) ? super.getString(path) : ChatColor.translateAlternateColorCodes('&', super.getString(path));
}
return "";
}
// This is the text that shows when registering the custom entity