diff --git a/src/main/java/me/skymc/taboolib/common/configuration/TConfiguration.java b/src/main/java/me/skymc/taboolib/common/configuration/TConfiguration.java index c53525f..8c948ce 100644 --- a/src/main/java/me/skymc/taboolib/common/configuration/TConfiguration.java +++ b/src/main/java/me/skymc/taboolib/common/configuration/TConfiguration.java @@ -3,6 +3,7 @@ package me.skymc.taboolib.common.configuration; import com.google.common.collect.Maps; import com.ilummc.tlib.TLib; import com.ilummc.tlib.logger.TLogger; +import com.ilummc.tlib.resources.TLocale; import com.ilummc.tlib.util.Ref; import me.skymc.taboolib.Main; import me.skymc.taboolib.TabooLib; @@ -35,6 +36,10 @@ public class TConfiguration extends YamlConfiguration { TabooLib.debug("Loaded TConfiguration \"" + file.getName() + "\" from Plugin \"" + plugin.getName() + "\""); } + public static Map> getFiles() { + return files; + } + /** * 创建配置文件 * @@ -71,8 +76,16 @@ public class TConfiguration extends YamlConfiguration { return create(file, plugin); } - public static Map> getFiles() { - return files; + public String getStringColored(String path) { + return TLocale.Translate.setColored(getString(path)); + } + + public String getStringColored(String path, String def) { + return TLocale.Translate.setColored(getString(path, def)); + } + + public List getStringListColored(String path) { + return TLocale.Translate.setColored(getStringList(path)); } public void release() { @@ -94,14 +107,6 @@ public class TConfiguration extends YamlConfiguration { // // ********************************* - public void runListener() { - try { - Optional.ofNullable(runnable).ifPresent(Runnable::run); - } catch (Exception e) { - e.printStackTrace(); - } - } - public File getFile() { return file; } @@ -110,4 +115,12 @@ public class TConfiguration extends YamlConfiguration { this.runnable = runnable; return this; } + + public void runListener() { + try { + Optional.ofNullable(runnable).ifPresent(Runnable::run); + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/src/main/java/me/skymc/taboolib/common/json/TJsonArray.java b/src/main/java/me/skymc/taboolib/common/json/TJsonArray.java index 9851af1..f094d7d 100644 --- a/src/main/java/me/skymc/taboolib/common/json/TJsonArray.java +++ b/src/main/java/me/skymc/taboolib/common/json/TJsonArray.java @@ -9,6 +9,8 @@ import java.util.Spliterator; import java.util.function.Consumer; /** + * 让 JsonObject 有更加人性化的操作,目前版本只能获取数据。 + * * @Author 坏黑 * @Since 2018-10-27 23:46 */ diff --git a/src/main/java/me/skymc/taboolib/common/json/TJsonObject.java b/src/main/java/me/skymc/taboolib/common/json/TJsonObject.java index 6f0380f..fb24546 100644 --- a/src/main/java/me/skymc/taboolib/common/json/TJsonObject.java +++ b/src/main/java/me/skymc/taboolib/common/json/TJsonObject.java @@ -6,6 +6,8 @@ import java.util.*; import java.util.stream.Collectors; /** + * 让 JsonObject 有更加人性化的操作,目前版本只能获取数据。 + * * @Author 坏黑 * @Since 2018-10-27 23:06 */