3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-25 15:50:14 +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)
Dieser Commit ist enthalten in:
chris 2023-12-06 08:26:20 +01:00 committet von GitHub
Ursprung 95d65350e4
Commit c0f6a2b926
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 12 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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()) {

Datei anzeigen

@ -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;