Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +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:
Ursprung
95d65350e4
Commit
c0f6a2b926
@ -43,21 +43,27 @@ import java.util.stream.Collectors;
|
|||||||
@Getter
|
@Getter
|
||||||
public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
||||||
|
|
||||||
private String platformVersion = null;
|
private final String platformName;
|
||||||
|
private String platformVersion;
|
||||||
|
private final String minecraftVersion;
|
||||||
private final EnvType environmentType;
|
private final EnvType environmentType;
|
||||||
|
|
||||||
@AsteriskSerializer.Asterisk(isIp = true)
|
@AsteriskSerializer.Asterisk(isIp = true)
|
||||||
private final String serverIP;
|
private final String serverIP;
|
||||||
private final int serverPort;
|
private final int serverPort;
|
||||||
|
private final boolean onlineMode;
|
||||||
private final List<ModInfo> mods;
|
private final List<ModInfo> mods;
|
||||||
|
|
||||||
public GeyserFabricDumpInfo(MinecraftServer server) {
|
public GeyserFabricDumpInfo(MinecraftServer server) {
|
||||||
|
this.platformName = server.getServerModName();
|
||||||
FabricLoader.getInstance().getModContainer("fabricloader").ifPresent(mod ->
|
FabricLoader.getInstance().getModContainer("fabricloader").ifPresent(mod ->
|
||||||
this.platformVersion = mod.getMetadata().getVersion().getFriendlyString());
|
this.platformVersion = mod.getMetadata().getVersion().getFriendlyString());
|
||||||
|
|
||||||
|
this.minecraftVersion = server.getServerVersion();
|
||||||
this.environmentType = FabricLoader.getInstance().getEnvironmentType();
|
this.environmentType = FabricLoader.getInstance().getEnvironmentType();
|
||||||
this.serverIP = server.getLocalIp() == null ? "unknown" : server.getLocalIp();
|
this.serverIP = server.getLocalIp() == null ? "unknown" : server.getLocalIp();
|
||||||
this.serverPort = server.getPort();
|
this.serverPort = server.getPort();
|
||||||
|
this.onlineMode = server.usesAuthentication();
|
||||||
this.mods = new ArrayList<>();
|
this.mods = new ArrayList<>();
|
||||||
|
|
||||||
for (ModContainer mod : FabricLoader.getInstance().getAllMods()) {
|
for (ModContainer mod : FabricLoader.getInstance().getAllMods()) {
|
||||||
|
@ -68,6 +68,11 @@ public class AsteriskSerializer extends StdSerializer<Object> implements Context
|
|||||||
String asterisk;
|
String asterisk;
|
||||||
boolean isIp;
|
boolean isIp;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // Used by Jackson for Geyser dumps
|
||||||
|
public AsteriskSerializer() {
|
||||||
|
super(Object.class);
|
||||||
|
}
|
||||||
|
|
||||||
public AsteriskSerializer(String asterisk, boolean isIp) {
|
public AsteriskSerializer(String asterisk, boolean isIp) {
|
||||||
super(Object.class);
|
super(Object.class);
|
||||||
this.asterisk = asterisk;
|
this.asterisk = asterisk;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren