1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-04-07 20:55:45 +02:00

New title type explanations for _EXAMPLE job

This commit is contained in:
Zrips 2021-01-06 16:48:46 +02:00
parent d3d2b06685
commit 23091b4bf2
3 changed files with 17 additions and 2 deletions
src/main/java/com/gamingmesh/jobs

View File

@ -191,11 +191,23 @@ public class ConfigReader extends YamlConfiguration {
return yaml; return yaml;
} }
public void appendComment(String path, String... commentLines) {
addComment(path, true, commentLines);
}
public void addComment(String path, String... commentLines) { public void addComment(String path, String... commentLines) {
addComment(path, false, commentLines);
}
public void addComment(String path, boolean append, String... commentLines) {
if (this.p != null) if (this.p != null)
path = this.p + path; path = this.p + path;
StringBuilder commentstring = new StringBuilder(); StringBuilder commentstring = new StringBuilder();
if (append && comments.containsKey(path)) {
commentstring.append(comments.get(path));
}
String leadingSpaces = ""; String leadingSpaces = "";
for (int n = 0; n < path.length(); n++) { for (int n = 0; n < path.length(); n++) {
if (path.charAt(n) == '.') { if (path.charAt(n) == '.') {

View File

@ -120,7 +120,10 @@ public class ConfigManager {
cfg.addComment(pt + ".BossBarColour", "[OPTIONAL] The colour of the boss bar: GREEN, BLUE, RED, WHITE, YELLOW, PINK, PURPLE."); cfg.addComment(pt + ".BossBarColour", "[OPTIONAL] The colour of the boss bar: GREEN, BLUE, RED, WHITE, YELLOW, PINK, PURPLE.");
cfg.get(pt + ".BossBarColour", "WHITE"); cfg.get(pt + ".BossBarColour", "WHITE");
cfg.addComment(pt + ".chat-display", "Option to let you choose what kind of prefix this job adds to your name.", "options are: full, title, job, shortfull, shorttitle, shortjob and none"); cfg.addComment(pt + ".chat-display", "Option to let you choose what kind of prefix this job adds to your name.", "Options are: ");
for (DisplayMethod one : DisplayMethod.values()) {
cfg.appendComment(pt + ".chat-display", one.getName() + " - " + one.getDesc());
}
cfg.get(pt + ".chat-display", "full"); cfg.get(pt + ".chat-display", "full");
cfg.addComment(pt + ".max-level", "[OPTIONAL] - the maximum level of this class"); cfg.addComment(pt + ".max-level", "[OPTIONAL] - the maximum level of this class");

View File

@ -19,10 +19,10 @@
package com.gamingmesh.jobs.container; package com.gamingmesh.jobs.container;
public enum DisplayMethod { public enum DisplayMethod {
NONE("none", "Nothing"),
FULL("full", "Full title and job name"), FULL("full", "Full title and job name"),
JOB("job", "Full job name"), JOB("job", "Full job name"),
TITLE("title", "Full title"), TITLE("title", "Full title"),
NONE("none", "Nothing"),
SHORT_FULL("shortfull", "Short title and job name"), SHORT_FULL("shortfull", "Short title and job name"),
SHORT_JOB("shortjob", "Short job name"), SHORT_JOB("shortjob", "Short job name"),
SHORT_TITLE("shorttitle", "Short title"), SHORT_TITLE("shorttitle", "Short title"),