mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Add platform and environment type to dump
This commit is contained in:
parent
31a7b798f1
commit
e8b2bff951
1 changed files with 23 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
package org.geysermc.platform.fabric;
|
package org.geysermc.platform.fabric;
|
||||||
|
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.fabricmc.loader.api.ModContainer;
|
import net.fabricmc.loader.api.ModContainer;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
@ -34,14 +35,25 @@ import org.geysermc.connector.dump.BootstrapDumpInfo;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // The way that the dump renders makes them used
|
||||||
public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
||||||
|
|
||||||
private String serverIP;
|
private String platformVersion = null;
|
||||||
private int serverPort;
|
private final EnvType environmentType;
|
||||||
private List<ModInfo> mods;
|
|
||||||
|
private final String serverIP;
|
||||||
|
private final int serverPort;
|
||||||
|
private final List<ModInfo> mods;
|
||||||
|
|
||||||
public GeyserFabricDumpInfo(MinecraftServer server) {
|
public GeyserFabricDumpInfo(MinecraftServer server) {
|
||||||
super();
|
super();
|
||||||
|
for (ModContainer modContainer : FabricLoader.getInstance().getAllMods()) {
|
||||||
|
if (modContainer.getMetadata().getId().equals("fabricloader")) {
|
||||||
|
this.platformVersion = modContainer.getMetadata().getVersion().getFriendlyString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.environmentType = FabricLoader.getInstance().getEnvironmentType();
|
||||||
if (AsteriskSerializer.showSensitive || (server.getServerIp() == null || server.getServerIp().equals("") || server.getServerIp().equals("0.0.0.0"))) {
|
if (AsteriskSerializer.showSensitive || (server.getServerIp() == null || server.getServerIp().equals("") || server.getServerIp().equals("0.0.0.0"))) {
|
||||||
this.serverIP = server.getServerIp();
|
this.serverIP = server.getServerIp();
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,6 +67,14 @@ public class GeyserFabricDumpInfo extends BootstrapDumpInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPlatformVersion() {
|
||||||
|
return platformVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnvType getEnvironmentType() {
|
||||||
|
return environmentType;
|
||||||
|
}
|
||||||
|
|
||||||
public String getServerIP() {
|
public String getServerIP() {
|
||||||
return this.serverIP;
|
return this.serverIP;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue