Follows specified address/port in remote config for plugin versions: fix #1110 (#1145)

* fix #1110

* updating comments in config.yml

* Fix indentation

* Centralize localhost retrieval; remove unnecessary Docker check

* Add config.yml

Co-authored-by: DoctorMacc <toy.fighter1@gmail.com>
This commit is contained in:
R-Josef 2020-08-16 12:45:52 -05:00 committed by GitHub
parent 1ead2900a3
commit 0e91475c62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 51 deletions

View file

@ -92,18 +92,15 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
InetSocketAddress javaAddr = proxyServer.getBoundAddress();
// 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 (!javaAddr.getHostString().equals("0.0.0.0") && !javaAddr.getHostString().equals("")) {
geyserConfig.getRemote().setAddress(javaAddr.getHostString());
// By default this should be localhost but may need to be changed in some circumstances
if (this.geyserConfig.getRemote().getAddress().equalsIgnoreCase("auto")) {
geyserConfig.getRemote().setPort(javaAddr.getPort());
}
if (geyserConfig.getBedrock().isCloneRemotePort()) {
geyserConfig.getBedrock().setPort(javaAddr.getPort());
}
geyserConfig.getRemote().setPort(javaAddr.getPort());
this.geyserLogger = new GeyserVelocityLogger(logger, geyserConfig.isDebugMode());
GeyserConfiguration.checkGeyserConfiguration(geyserConfig, geyserLogger);