upload client name and server address as description
This commit is contained in:
@@ -2,6 +2,7 @@ package dev.photosync.platform.impl;
|
||||
|
||||
import dev.photosync.core.capture.CameraPose;
|
||||
import dev.photosync.mcapi.GameContext;
|
||||
import dev.photosync.platform.WindowTitle;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.Util;
|
||||
@@ -88,6 +89,18 @@ public final class GameAdapter implements GameContext {
|
||||
return minecraftVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String clientName() {
|
||||
String title = WindowTitle.last();
|
||||
return title == null || title.isBlank() ? "Minecraft" : title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<String> serverAddress() {
|
||||
return Optional.ofNullable(Minecraft.getInstance().getCurrentServer())
|
||||
.map(server -> server.ip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quit() {
|
||||
Minecraft.getInstance().stop();
|
||||
|
||||
Reference in New Issue
Block a user