From 01efec4092a8aa70ebeae5c74ed3e6f3a6fd9c61 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 23 Jun 2021 19:21:59 -0400 Subject: [PATCH] Add a fix for #42 that doesn't involve deleting the configuration files Also add link default language.yml to the readme. --- README.md | 7 +++++-- .../net/seanomik/tamablefoxes/util/io/LanguageConfig.java | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d320263..d4643de 100644 --- a/README.md +++ b/README.md @@ -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 ``` -### Default Config - +### Default configurations: +* Default config.yml +* Default language.yml
+ If you get any errors, create an issue!

+ Have you ever wanted to tame foxes? Well, now you can! Use chicken to tame and sweet berries to breed them!

### Features: diff --git a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/LanguageConfig.java b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/LanguageConfig.java index e5e8c97..eb6b2f6 100644 --- a/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/LanguageConfig.java +++ b/Utility/src/main/java/net/seanomik/tamablefoxes/util/io/LanguageConfig.java @@ -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