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
|
@ -29,11 +29,13 @@ import net.md_5.bungee.config.Configuration;
|
|||
|
||||
import org.geysermc.common.IGeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
||||
|
||||
private File dataFolder;
|
||||
private Configuration config;
|
||||
|
||||
private BungeeBedrockConfiguration bedrockConfig;
|
||||
|
@ -42,7 +44,8 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
|
||||
private Map<String, BungeeUserAuthenticationInfo> userAuthInfo = new HashMap<>();
|
||||
|
||||
public GeyserBungeeConfiguration(Configuration config) {
|
||||
public GeyserBungeeConfiguration(File dataFolder, Configuration config) {
|
||||
this.dataFolder = dataFolder;
|
||||
this.config = config;
|
||||
|
||||
bedrockConfig = new BungeeBedrockConfiguration();
|
||||
|
@ -98,8 +101,8 @@ public class GeyserBungeeConfiguration implements IGeyserConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getFloodgateKeyFile() {
|
||||
return config.getString("floodgate-key-file", "public-key.pem");
|
||||
public File getFloodgateKeyFile() {
|
||||
return new File(dataFolder, config.getString("floodgate-key-file", "public-key.pem"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -73,7 +73,7 @@ public class GeyserBungeePlugin extends Plugin implements IGeyserBootstrap {
|
|||
return;
|
||||
}
|
||||
|
||||
geyserConfig = new GeyserBungeeConfiguration(configuration);
|
||||
geyserConfig = new GeyserBungeeConfiguration(getDataFolder(), configuration);
|
||||
|
||||
if (geyserConfig.getMetrics().getUniqueId().equals("generateduuid")) {
|
||||
configuration.set("metrics.uuid", UUID.randomUUID().toString());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue