add location to the server response
Some checks failed
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Failing after 57s

This commit is contained in:
Lee
2024-04-21 23:27:44 +01:00
parent bf992713dc
commit 3faf2d3319
9 changed files with 217 additions and 11 deletions

View File

@ -32,8 +32,8 @@ public final class BedrockMinecraftServer extends MinecraftServer {
private BedrockMinecraftServer(@NonNull String id, @NonNull String hostname, String ip, int port, @NonNull DNSRecord[] records,
@NonNull Edition edition, @NonNull Version version, @NonNull Players players, @NonNull MOTD motd,
@NonNull GameMode gamemode) {
super(hostname, ip, port, records, motd, players);
@NonNull GameMode gamemode, GeoLocation location) {
super(hostname, ip, port, records, motd, players, location);
this.id = id;
this.edition = edition;
this.version = version;
@ -53,7 +53,7 @@ public final class BedrockMinecraftServer extends MinecraftServer {
* @return the Bedrock Minecraft server
*/
@NonNull
public static BedrockMinecraftServer create(@NonNull String hostname, String ip, int port, DNSRecord[] records, @NonNull String token) {
public static BedrockMinecraftServer create(@NonNull String hostname, String ip, int port, DNSRecord[] records, GeoLocation location, @NonNull String token) {
String[] split = token.split(";"); // Split the token
Edition edition = Edition.valueOf(split[0]);
Version version = new Version(Integer.parseInt(split[2]), split[3]);
@ -70,7 +70,8 @@ public final class BedrockMinecraftServer extends MinecraftServer {
version,
players,
motd,
gameMode
gameMode,
location
);
}