
`StringUtils.getWorldOrServerName` returns `null` if Minecraft is started with `--server` option (autoconnect)
globau opened this issue ยท 1 comments
If Minecraft is started with the -server
option to automatically connect to a multiplayer server on launch, sadly MinecraftClient
's getCurrentServerData/getCurrentServerEntry
method returns null
, which is then the result of StringUtils.getWorldOrServerName
.
This results in some weirdness in Litematica - eg. placements are never saved.
One workaround is to inject MinecraftClient
's constructor to grab the command line args, falling back to args.autoConnect.serverAddress
if MinecraftClient.getCurrentServerEntry()
returns null.