Merge branch 'master' into feature/sounds

This commit is contained in:
RednedEpic 2020-05-04 00:51:22 -05:00
commit 7d67b65777
8 changed files with 98 additions and 9 deletions

View file

@ -25,7 +25,10 @@
package org.geysermc.platform.bukkit;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.Plugin;
import org.geysermc.connector.FloodgateKeyLoader;
import org.geysermc.connector.GeyserConfiguration;
import java.io.File;
@ -45,6 +48,8 @@ public class GeyserBukkitConfiguration implements GeyserConfiguration {
private Map<String, BukkitUserAuthenticationInfo> userAuthInfo = new HashMap<>();
private Path floodgateKey;
public GeyserBukkitConfiguration(File dataFolder, FileConfiguration config) {
this.dataFolder = dataFolder;
this.config = config;
@ -61,6 +66,11 @@ public class GeyserBukkitConfiguration implements GeyserConfiguration {
}
}
public void loadFloodgate(GeyserBukkitPlugin plugin) {
Plugin floodgate = Bukkit.getPluginManager().getPlugin("floodgate-bukkit");
floodgateKey = FloodgateKeyLoader.getKey(plugin.getGeyserLogger(), this, Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem")), floodgate, floodgate != null ? floodgate.getDataFolder().toPath() : null);
}
@Override
public IBedrockConfiguration getBedrock() {
return bedrockConfig;
@ -108,7 +118,7 @@ public class GeyserBukkitConfiguration implements GeyserConfiguration {
@Override
public Path getFloodgateKeyFile() {
return Paths.get(dataFolder.toString(), config.getString("floodgate-key-file", "public-key.pem"));
return floodgateKey;
}
@Override

View file

@ -67,6 +67,9 @@ public class GeyserBukkitPlugin extends JavaPlugin implements GeyserBootstrap {
saveConfig();
this.geyserLogger = new GeyserBukkitLogger(getLogger(), geyserConfig.isDebugMode());
geyserConfig.loadFloodgate(this);
this.connector = GeyserConnector.start(PlatformType.BUKKIT, this);
this.geyserCommandManager = new GeyserBukkitCommandManager(this, connector);