mirror of
https://github.com/GeyserMC/GeyserConnect.git
synced 2025-06-26 14:15:22 +02:00
Server Config Improvements
Default port to 19132 for bedrock Enable name entry
This commit is contained in:
parent
34a5170f9b
commit
2ac45e83bd
1 changed files with 12 additions and 3 deletions
|
@ -35,12 +35,13 @@ import lombok.NoArgsConstructor;
|
|||
public class Server {
|
||||
|
||||
private String address;
|
||||
private int port = 25565;
|
||||
private int port = -1;
|
||||
private boolean online = true;
|
||||
private boolean bedrock = false;
|
||||
private String name = null;
|
||||
|
||||
public Server(String address) {
|
||||
this(address, 25565);
|
||||
this(address, -1);
|
||||
}
|
||||
|
||||
public Server(String address, int port) {
|
||||
|
@ -51,8 +52,16 @@ public class Server {
|
|||
this(address, port, online, false);
|
||||
}
|
||||
|
||||
public Server(String address, int port, boolean online, boolean bedrock) {
|
||||
this(address, port, online, false, null);
|
||||
}
|
||||
|
||||
private int defaultPort() { return bedrock ? 19132 : 25565; }
|
||||
|
||||
public int getPort() { return port < 0 ? defaultPort() : port; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return address + (port != (bedrock ? 19132 : 25565) ? ":" + port : "");
|
||||
return name != null ? name : address + (port != defaultPort() ? ":" + port : "");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue