mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-23 06:50:26 +01:00
Add more info to Fabric's geyser dumps (#4175)
* Added onlineMode, platformName, and Minecraft version to dump - renames platformVersion to loaderVersion since that is more fitting to modded structure * rename loaderVersion back to platformVersion * address review by @Konicai * Fix geyser dump creation (regression from the syntax/annotation PR)
This commit is contained in:
parent
95d65350e4
commit
c0f6a2b926
2 changed files with 12 additions and 1 deletions
|
@ -43,21 +43,27 @@ import java.util.stream.Collectors;
|
|||
@Getter
|
||||
public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
||||
|
||||
private String platformVersion = null;
|
||||
private final String platformName;
|
||||
private String platformVersion;
|
||||
private final String minecraftVersion;
|
||||
private final EnvType environmentType;
|
||||
|
||||
@AsteriskSerializer.Asterisk(isIp = true)
|
||||
private final String serverIP;
|
||||
private final int serverPort;
|
||||
private final boolean onlineMode;
|
||||
private final List<ModInfo> mods;
|
||||
|
||||
public GeyserFabricDumpInfo(MinecraftServer server) {
|
||||
this.platformName = server.getServerModName();
|
||||
FabricLoader.getInstance().getModContainer("fabricloader").ifPresent(mod ->
|
||||
this.platformVersion = mod.getMetadata().getVersion().getFriendlyString());
|
||||
|
||||
this.minecraftVersion = server.getServerVersion();
|
||||
this.environmentType = FabricLoader.getInstance().getEnvironmentType();
|
||||
this.serverIP = server.getLocalIp() == null ? "unknown" : server.getLocalIp();
|
||||
this.serverPort = server.getPort();
|
||||
this.onlineMode = server.usesAuthentication();
|
||||
this.mods = new ArrayList<>();
|
||||
|
||||
for (ModContainer mod : FabricLoader.getInstance().getAllMods()) {
|
||||
|
|
|
@ -68,6 +68,11 @@ public class AsteriskSerializer extends StdSerializer<Object> implements Context
|
|||
String asterisk;
|
||||
boolean isIp;
|
||||
|
||||
@SuppressWarnings("unused") // Used by Jackson for Geyser dumps
|
||||
public AsteriskSerializer() {
|
||||
super(Object.class);
|
||||
}
|
||||
|
||||
public AsteriskSerializer(String asterisk, boolean isIp) {
|
||||
super(Object.class);
|
||||
this.asterisk = asterisk;
|
||||
|
|
Loading…
Reference in a new issue