Skip to content

[?bug?] Minecraft.getCurrentServerData().forgeData == null if ping to server fails #6070

@YouDirk

Description

@YouDirk

Minecraft Version: 1.13.2 (1.14.x not tested)

Forge Version: 1.13.2-25.0.219

Logs: ---

Steps to Reproduce:

  1. Main-Menu -> Multiplayer
  2. Click Refresh until pinging was failed
  3. Connect to un-pinged server (modded or vanilla)

Description of issue:

At first, I'm not sure if it is a bug. But in my point of view it´s an unexpected behaviour.

After connecting to the un-pinged server on physically client Minecraft.getCurrentServerData().forgeData == null is set. I use Minecraft.getCurrentServerData().forgeData.type to find out if the client has connected to a vanilla server. But it is not possible if the server was not pinged previously.

Also the client sides clientAcceptedVersions(String serverVersion) from NetworkRegistry::newSimpleChannel(..., Predicate<String> clientAcceptedVersions, ...) is not performed in this case. If the server was pinged then the call looks like clientAcceptedVersions("ALLOWVANILLA.*").

I understand for compatibility it should be possible that the client can try to connect to an unknown/un-pinged server (i.e. firewall blocks something). But I think it should popup a warning to the user that she/he connects to a server without any compatibility-checks.

Current Workaround

My current work-around is to send a SimpleChannel message to the server. If the client receive a reply to it then the server is modded, otherwise not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions