Skip to content

Commit

Permalink
don't try loading server config if non-existent as on game servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarsz committed Jan 16, 2024
1 parent 23a152a commit 6889a11
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package me.minecraftauth.plugin.common.feature.gatekeeper;

import alexh.weak.Dynamic;
import com.udojava.evalex.AbstractOperator;
import com.udojava.evalex.Operator;
import lombok.Getter;
Expand Down Expand Up @@ -126,10 +127,13 @@ public void reload() {
realms.put(null, superRealm);
}

service.getConfig().dget("Gatekeeper.Servers").children().forEach(child -> {
String server = child.key().convert().intoString();
realms.put(server, new Realm(this, child, server));
});
Dynamic serversDynamic = service.getConfig().dget("Gatekeeper.Servers");
if (serversDynamic.isPresent()) {
serversDynamic.children().forEach(child -> {
String server = child.key().convert().intoString();
realms.put(server, new Realm(this, child, server));
});
}

boolean onlySuper = realms.keySet().stream().allMatch(Objects::isNull);
int expressionCount = realms.values().stream().mapToInt(realm -> realm.getExpressions().size()).sum();
Expand Down

0 comments on commit 6889a11

Please sign in to comment.