forked from GeyserMC/Geyser
Search for key in Geyser plugin folder in plugin versions
This commit is contained in:
parent
ba724bb7d6
commit
cc3cf70257
8 changed files with 24 additions and 14 deletions
|
@ -31,12 +31,14 @@ import ninja.leaping.configurate.ConfigurationNode;
|
|||
|
||||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class GeyserSpongeConfiguration implements IGeyserConfiguration {
|
||||
|
||||
private File dataFolder;
|
||||
private ConfigurationNode node;
|
||||
|
||||
private SpongeBedrockConfiguration bedrockConfig;
|
||||
|
@ -45,7 +47,8 @@ public class GeyserSpongeConfiguration implements IGeyserConfiguration {
|
|||
|
||||
private Map<String, SpongeUserAuthenticationInfo> userAuthInfo = new HashMap<>();
|
||||
|
||||
public GeyserSpongeConfiguration(ConfigurationNode node) {
|
||||
public GeyserSpongeConfiguration(File dataFolder, ConfigurationNode node) {
|
||||
this.dataFolder = dataFolder;
|
||||
this.node = node;
|
||||
|
||||
this.bedrockConfig = new SpongeBedrockConfiguration(node.getNode("bedrock"));
|
||||
|
@ -101,8 +104,8 @@ public class GeyserSpongeConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getFloodgateKeyFile() {
|
||||
return node.getNode("floodgate-key-file").getString("public-key.pem");
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(dataFolder, node.getNode("floodgate-key-file").getString("public-key.pem"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -73,7 +73,7 @@ public class GeyserSpongePlugin implements IGeyserBootstrap {
|
|||
|
||||
ConfigurationLoader loader = YAMLConfigurationLoader.builder().setPath(configFile.toPath()).build();
|
||||
try {
|
||||
this.geyserConfig = new GeyserSpongeConfiguration(loader.load());
|
||||
this.geyserConfig = new GeyserSpongeConfiguration(configDir, loader.load());
|
||||
} catch (IOException ex) {
|
||||
logger.warn("Failed to load config.yml!");
|
||||
ex.printStackTrace();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue