use new mojang endpoint status model
This commit is contained in:
182
src/main/java/xyz/mcutils/models/cache/CachedJavaMinecraftServer.java
vendored
Normal file
182
src/main/java/xyz/mcutils/models/cache/CachedJavaMinecraftServer.java
vendored
Normal file
@ -0,0 +1,182 @@
|
||||
package xyz.mcutils.models.cache;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import xyz.mcutils.models.server.MinecraftServer;
|
||||
|
||||
@Getter
|
||||
public class CachedJavaMinecraftServer extends MinecraftServer {
|
||||
|
||||
/**
|
||||
* The version of the server.
|
||||
*/
|
||||
private Version version;
|
||||
|
||||
/**
|
||||
* The favicon of the server.
|
||||
*/
|
||||
private Favicon favicon;
|
||||
|
||||
/**
|
||||
* The mods running on this server.
|
||||
*/
|
||||
private ForgeModInfo modInfo;
|
||||
|
||||
/**
|
||||
* The mods running on this server.
|
||||
* <p>
|
||||
* This is only used for servers
|
||||
* running 1.13 and above.
|
||||
* </p>
|
||||
*/
|
||||
private ForgeData forgeData;
|
||||
|
||||
/**
|
||||
* Whether the server prevents chat reports.
|
||||
*/
|
||||
private boolean preventsChatReports;
|
||||
|
||||
/**
|
||||
* Whether the server enforces secure chat.
|
||||
*/
|
||||
private boolean enforcesSecureChat;
|
||||
|
||||
/**
|
||||
* Whether the server has previews chat enabled.
|
||||
* <p>
|
||||
* Chat Preview sends chat messages to the server as they are typed, even before they're sent.
|
||||
* <a href="https://www.minecraft.net/es-mx/article/minecraft-snapshot-22w19a">More information</a>
|
||||
* </p>
|
||||
*/
|
||||
private boolean previewsChat;
|
||||
|
||||
/**
|
||||
* The mojang blocked status for the server.
|
||||
*/
|
||||
private boolean mojangBlocked;
|
||||
|
||||
@Getter
|
||||
public static class Version {
|
||||
/**
|
||||
* The version name of the server.
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The server platform.
|
||||
*/
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* The protocol version.
|
||||
*/
|
||||
private int protocol;
|
||||
|
||||
/**
|
||||
* The name of the protocol, null if not found.
|
||||
*/
|
||||
private String protocolName;
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class Favicon {
|
||||
|
||||
/**
|
||||
* The raw base64 of the favicon.
|
||||
*/
|
||||
private String base64;
|
||||
|
||||
/**
|
||||
* The url to the favicon.
|
||||
*/
|
||||
private String url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forge mod information for a server.
|
||||
*/
|
||||
@Getter @ToString
|
||||
public static class ForgeModInfo {
|
||||
/**
|
||||
* The type of modded server this is.
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* The list of mods on this server, null or empty if none.
|
||||
*/
|
||||
private ForgeMod[] modList;
|
||||
|
||||
/**
|
||||
* A forge mod for a server.
|
||||
*/
|
||||
@Getter @ToString
|
||||
private static class ForgeMod {
|
||||
/**
|
||||
* The id of this mod.
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The version of this mod.
|
||||
*/
|
||||
private String version;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class ForgeData {
|
||||
|
||||
/**
|
||||
* The list of mod channels on this server, null or empty if none.
|
||||
*/
|
||||
private Channel[] channels;
|
||||
|
||||
/**
|
||||
* The list of mods on this server, null or empty if none.
|
||||
*/
|
||||
private Mod[] mods;
|
||||
|
||||
/**
|
||||
* Whether the mod list is truncated.
|
||||
*/
|
||||
private boolean truncated;
|
||||
|
||||
/**
|
||||
* The version of the FML network.
|
||||
*/
|
||||
private int fmlNetworkVersion;
|
||||
|
||||
@Getter
|
||||
public static class Channel {
|
||||
/**
|
||||
* The id of this mod channel.
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The version of this mod channel.
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* Whether this mod channel is required to join.
|
||||
*/
|
||||
private boolean required;
|
||||
}
|
||||
|
||||
@Getter
|
||||
public static class Mod {
|
||||
/**
|
||||
* The id of this mod.
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* The version of this mod.
|
||||
*/
|
||||
private String version;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user