Skip to content

Commit

Permalink
Fix startup bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 1, 2022
1 parent 16a8e77 commit bf6eaba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,7 @@ default void processConfig(Path dataDirectory) {
Path file = dataDirectory.resolve("config.yml");

if (!Files.exists(file)) {
try {
Files.copy(Objects.requireNonNull(PistonQueuePlugin.class.getClassLoader().getResourceAsStream("proxy_config.yml")), file);
loadConfig(dataDirectory);
return;
} catch (IOException ie) {
ie.printStackTrace();
}
Files.copy(Objects.requireNonNull(PistonQueuePlugin.class.getClassLoader().getResourceAsStream("proxy_config.yml")), file);
}

loadConfig(file);
Expand All @@ -310,7 +304,7 @@ default void loadConfig(Path file) throws IOException {
String fieldName = it.getName();
if (List.class.isAssignableFrom(it.getType())) {
it.set(Config.class, config.node(fieldName).getList(String.class));
} else if (QueueType.class.isAssignableFrom(it.getType())) {
} else if (fieldName.equals("QUEUE_TYPES")) {
if (it.get(Config.class) == null) { // We will never replace on reload
val queueTypes = config.node("QUEUE_TYPES").childrenMap();
val array = new QueueType[queueTypes.size()];
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/proxy_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SERVER_ONLINE_CHECK_DELAY: 500

# Where to send the queue position message and what to send.
POSITION_MESSAGE_CHAT: true
POSITION_MESSAGE_HOTBAR: false
POSITION_MESSAGE_HOT_BAR: false
QUEUE_POSITION: "&6Position in queue: &l%position%"
POSITION_MESSAGE_DELAY: 10000

Expand Down

0 comments on commit bf6eaba

Please sign in to comment.