add mods and plugins to server response
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m31s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m31s
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package cc.fascinated.model.cache;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.redis.core.RedisHash;
|
||||
|
||||
|
@ -22,6 +22,16 @@ public final class JavaServerStatusToken {
|
||||
*/
|
||||
private final MinecraftServer.Players players;
|
||||
|
||||
/**
|
||||
* The mods running on the server.
|
||||
*/
|
||||
private final MinecraftServer.Mod[] mods;
|
||||
|
||||
/**
|
||||
* The plugins running on the server.
|
||||
*/
|
||||
private final MinecraftServer.Plugin[] plugins;
|
||||
|
||||
/**
|
||||
* The motd of the server.
|
||||
*/
|
||||
|
@ -28,15 +28,28 @@ public final class JavaMinecraftServer extends MinecraftServer {
|
||||
*/
|
||||
private Favicon favicon;
|
||||
|
||||
/**
|
||||
* The mods of the server.
|
||||
*/
|
||||
private MinecraftServer.Mod[] mods;
|
||||
|
||||
/**
|
||||
* The plugins of the server.
|
||||
*/
|
||||
private MinecraftServer.Plugin[] plugins;
|
||||
|
||||
/**
|
||||
* The mojang banned status of the server.
|
||||
*/
|
||||
private boolean mojangBanned;
|
||||
|
||||
public JavaMinecraftServer(String hostname, String ip, int port, MOTD motd, @NonNull Version version, Players players, Favicon favicon) {
|
||||
public JavaMinecraftServer(String hostname, String ip, int port, MOTD motd, Players players,
|
||||
@NonNull Version version, Favicon favicon, Mod[] mods, Plugin[] plugins) {
|
||||
super(hostname, ip, port, motd, players);
|
||||
this.version = version;
|
||||
this.favicon = favicon;
|
||||
this.mods = mods;
|
||||
this.plugins = plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,9 +72,11 @@ public final class JavaMinecraftServer extends MinecraftServer {
|
||||
ip,
|
||||
port,
|
||||
MinecraftServer.MOTD.create(motdString),
|
||||
token.getVersion().detailedCopy(),
|
||||
token.getPlayers(),
|
||||
JavaMinecraftServer.Favicon.create(token.getFavicon(), ServerUtils.getAddress(hostname, port))
|
||||
token.getVersion().detailedCopy(),
|
||||
JavaMinecraftServer.Favicon.create(token.getFavicon(), ServerUtils.getAddress(hostname, port)),
|
||||
token.getMods(),
|
||||
token.getPlugins()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public class MinecraftServer {
|
||||
/**
|
||||
* Player count data for a server.
|
||||
*/
|
||||
@AllArgsConstructor @Getter @ToString
|
||||
@AllArgsConstructor @Getter
|
||||
public static class Players {
|
||||
/**
|
||||
* The online players on this server.
|
||||
@ -141,4 +141,40 @@ public class MinecraftServer {
|
||||
@NonNull private final String name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mod data for a server.
|
||||
*/
|
||||
@AllArgsConstructor @Getter
|
||||
public static final class Mod {
|
||||
|
||||
/**
|
||||
* The name of the mod.
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
|
||||
/**
|
||||
* The version of the mod.
|
||||
*/
|
||||
private final String version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin data for a server.
|
||||
*/
|
||||
@AllArgsConstructor @Getter
|
||||
public static final class Plugin {
|
||||
|
||||
/**
|
||||
* The name of the plugin.
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
|
||||
/**
|
||||
* The version of the plugin.
|
||||
*/
|
||||
private final String version;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user