Skip to content

ConcurrentModificationException during world load in single player #6

Description

@JaisDK

https://gnomebot.dev/paste/mclogs/9clgQn9

Because HiddenManager.hidden is a static that's shared between the internal server and the client when you're in single player, modifying it on one side while it's being iterated on the other side can cause a CME.

It get modified here after the client sync https://github.com/Cmdpro/Databank/blob/main/src/main/java/com/cmdpro/databank/handlers/ModEventHandler.java#L52
while on the client it's being cleared and refilled.

These two lines https://github.com/Cmdpro/Databank/blob/main/src/main/java/com/cmdpro/databank/networking/packet/HiddenSyncS2CPacket.java#L41-L42

HiddenManager.hidden.clear();
HiddenManager.hidden.putAll(hidden);

need to be HiddenManager.hidden = new HashMap<>(hidden);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions