diff options
| author | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-07-21 21:25:00 +0100 |
|---|---|---|
| committer | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-07-21 21:25:01 +0100 |
| commit | bcd4d141c04768c2ed3d00d4963e4f40424b5bc4 (patch) | |
| tree | b79a965aaa19bee8f859f1de5272feae2fbb0153 /src/main/java/me/fatpigsarefat/quests/obj/Options.java | |
| parent | 56aae6d737aa523f23160256b5022b8cce8fe9c5 (diff) | |
Now using Maven
- pom.xml was added
- Source files moved
- .gitignore adjusted to allow .xml
- All Title classes changed to use Bukkit method instead
Diffstat (limited to 'src/main/java/me/fatpigsarefat/quests/obj/Options.java')
| -rw-r--r-- | src/main/java/me/fatpigsarefat/quests/obj/Options.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/main/java/me/fatpigsarefat/quests/obj/Options.java b/src/main/java/me/fatpigsarefat/quests/obj/Options.java new file mode 100644 index 00000000..920f1132 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/obj/Options.java @@ -0,0 +1,53 @@ +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"), + GUI_HIDE_LOCKED("options.gui-hide-locked"), + GUITITLE_QUESTS_CATEGORY("options.guinames.quests-category"), + GUITITLE_QUESTS("options.guinames.quests-menu"), + GUITITLE_DAILY_QUESTS("options.guinames.daily-quests"), + ALLOW_QUEST_CANCEL("options.allow-quest-cancel"); + + 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; + } +} |
