forked from GeyserMC/Geyser
Auto-configure more if setting is enabled (#1168)
* Auto-configure more if setting is enabled - Geyser dumps now show if the config was automatic - Floodgate is now automatically detected if the address is also automatically found - If the plugin versions' servers have the listening address set to something different, set our remote address to that * Fix Sponge config * Remove redundant Getter
This commit is contained in:
parent
e7363b4e9f
commit
d6290ccb66
7 changed files with 52 additions and 11 deletions
|
@ -26,9 +26,7 @@
|
|||
package org.geysermc.platform.sponge;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
|
||||
import org.geysermc.connector.configuration.GeyserConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -41,6 +39,11 @@ public class GeyserSpongeConfiguration implements GeyserConfiguration {
|
|||
private File dataFolder;
|
||||
private ConfigurationNode node;
|
||||
|
||||
/**
|
||||
* If the config was originally 'auto' before the values changed
|
||||
*/
|
||||
private boolean autoconfiguredRemote = false;
|
||||
|
||||
private SpongeBedrockConfiguration bedrockConfig;
|
||||
private SpongeRemoteConfiguration remoteConfig;
|
||||
private SpongeMetricsInfo metricsInfo;
|
||||
|
@ -64,6 +67,10 @@ public class GeyserSpongeConfiguration implements GeyserConfiguration {
|
|||
}
|
||||
}
|
||||
|
||||
public void setAutoconfiguredRemote(boolean autoconfiguredRemote) {
|
||||
this.autoconfiguredRemote = autoconfiguredRemote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpongeBedrockConfiguration getBedrock() {
|
||||
return bedrockConfig;
|
||||
|
|
|
@ -29,11 +29,11 @@ import com.google.inject.Inject;
|
|||
import ninja.leaping.configurate.ConfigurationNode;
|
||||
import ninja.leaping.configurate.loader.ConfigurationLoader;
|
||||
import ninja.leaping.configurate.yaml.YAMLConfigurationLoader;
|
||||
import org.geysermc.connector.common.PlatformType;
|
||||
import org.geysermc.connector.configuration.GeyserConfiguration;
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.bootstrap.GeyserBootstrap;
|
||||
import org.geysermc.connector.command.CommandManager;
|
||||
import org.geysermc.connector.common.PlatformType;
|
||||
import org.geysermc.connector.configuration.GeyserConfiguration;
|
||||
import org.geysermc.connector.dump.BootstrapDumpInfo;
|
||||
import org.geysermc.connector.ping.GeyserLegacyPingPassthrough;
|
||||
import org.geysermc.connector.ping.IGeyserPingPassthrough;
|
||||
|
@ -105,6 +105,7 @@ public class GeyserSpongePlugin implements GeyserBootstrap {
|
|||
// Don't change the ip if its listening on all interfaces
|
||||
// By default this should be 127.0.0.1 but may need to be changed in some circumstances
|
||||
if (this.geyserConfig.getRemote().getAddress().equalsIgnoreCase("auto")) {
|
||||
this.geyserConfig.setAutoconfiguredRemote(true);
|
||||
serverPort.setValue(javaAddr.getPort());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue