summaryrefslogtreecommitdiffstats
path: root/src/me/fatpigsarefat/quests/obj/Options.java
diff options
context:
space:
mode:
authorfatpigsarefat <fatpigsarefat@outlook.com>2018-04-15 20:03:06 +0100
committerfatpigsarefat <fatpigsarefat@outlook.com>2018-04-15 20:04:38 +0100
commitfa91b320cb5ddbd19ac54b8504834270feb0f75a (patch)
tree6743345f191edfd14b371970de589c2cb3552656 /src/me/fatpigsarefat/quests/obj/Options.java
parent2361783c0982de3a8fd02fd96d10f5362af8b983 (diff)
Initial commit
Diffstat (limited to 'src/me/fatpigsarefat/quests/obj/Options.java')
-rw-r--r--src/me/fatpigsarefat/quests/obj/Options.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/me/fatpigsarefat/quests/obj/Options.java b/src/me/fatpigsarefat/quests/obj/Options.java
new file mode 100644
index 00000000..d4b63499
--- /dev/null
+++ b/src/me/fatpigsarefat/quests/obj/Options.java
@@ -0,0 +1,48 @@
+package me.fatpigsarefat.quests.obj;
+
+import me.fatpigsarefat.quests.Quests;
+import org.bukkit.ChatColor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public enum Options {
+
+ CATEGORIES_ENABLED("options.categories-enabled"),
+ TRIM_GUI_SIZE("options.trim-gui-size"),
+ QUESTS_START_LIMIT("options.quest-started-limit"),
+ TITLES_ENABLED("options.titles-enabled");
+
+ private String path;
+
+ Options(String path) {
+ this.path = path;
+ }
+
+ public int getIntValue() {
+ return Quests.getInstance().getConfig().getInt(path);
+ }
+
+ public String getStringValue() {
+ return Quests.getInstance().getConfig().getString(path);
+ }
+
+ public boolean getBooleanValue() {
+ return Quests.getInstance().getConfig().getBoolean(path);
+ }
+
+ public List<String> getStringListValue() {
+ return Quests.getInstance().getConfig().getStringList(path);
+ }
+
+ public static String color(String s) {
+ return ChatColor.translateAlternateColorCodes('&', s);
+ }
+ public static List<String> color(List<String> s) {
+ List<String> colored = new ArrayList<>();
+ for (String line : s) {
+ colored.add(ChatColor.translateAlternateColorCodes('&', line));
+ }
+ return colored;
+ }
+}