forked from GeyserMC/Geyser
Merge branch 'master' into sound-master
This commit is contained in:
commit
1fbb755d26
25 changed files with 498 additions and 89 deletions
|
@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import org.geysermc.connector.GeyserConfiguration;
|
||||
|
||||
|
@ -89,7 +90,10 @@ public class GeyserVelocityConfiguration implements GeyserConfiguration {
|
|||
@Getter
|
||||
public static class RemoteConfiguration implements IRemoteConfiguration {
|
||||
|
||||
@Setter
|
||||
private String address;
|
||||
|
||||
@Setter
|
||||
private int port;
|
||||
|
||||
private String motd1;
|
||||
|
|
|
@ -33,6 +33,7 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
|||
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
|
||||
import com.velocitypowered.api.plugin.Plugin;
|
||||
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import org.geysermc.common.PlatformType;
|
||||
import org.geysermc.connector.GeyserConnector;
|
||||
import org.geysermc.connector.bootstrap.GeyserBootstrap;
|
||||
|
@ -43,6 +44,7 @@ import org.slf4j.Logger;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.UUID;
|
||||
|
||||
@Plugin(id = "geyser", name = GeyserConnector.NAME + "-Velocity", version = GeyserConnector.VERSION, url = "https://geysermc.org", authors = "GeyserMC")
|
||||
|
@ -51,6 +53,9 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
|||
@Inject
|
||||
private Logger logger;
|
||||
|
||||
@Inject
|
||||
private ProxyServer server;
|
||||
|
||||
@Inject
|
||||
private CommandManager commandManager;
|
||||
|
||||
|
@ -73,6 +78,16 @@ public class GeyserVelocityPlugin implements GeyserBootstrap {
|
|||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
InetSocketAddress javaAddr = server.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")) {
|
||||
geyserConfig.getRemote().setAddress(javaAddr.getHostString());
|
||||
}
|
||||
|
||||
geyserConfig.getRemote().setPort(javaAddr.getPort());
|
||||
|
||||
this.geyserLogger = new GeyserVelocityLogger(logger, geyserConfig.isDebugMode());
|
||||
this.connector = GeyserConnector.start(PlatformType.VELOCITY, this);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue