Skip to content

A client joining a dedicated server with Celestria will crash #7

@wchen1990

Description

@wchen1990

When both client and server has Celestria the client will crash on Neoforge. This can also be replicated in the dev environment.

Exception:
java.lang.ClassCastException: class net.minecraft.client.player.LocalPlayer cannot be cast to class net.minecraft.server.level.ServerPlayer

The relevant line of code is here:

world.getPlayers().forEach(player -> PacketUtils.sendPlayPayloadS2C((ServerPlayerEntity) player, new WelcomePayload()));

Just needs a simple a type check or a check to see if the world is server side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions