Mojira Archive
MC-121152

WorldClient leaks player and painting entities

I've found a memory leak present in all minecraft versions I know

The problem is, entity added to world by "Spawn Player" Packet (ID 0x05 for 1.12.2), is added to "entityList" HashSet in "WorldClient" (according to MCP mapping) twice with different IDs, first time it added with client-generated entity ID, then correct entity ID is set and it added to same set again (but old one is not deleted because equals() method is based on entity ID)
The entity added first time will never be removed by "Destroy Entity" packet (ID 0x35 for 1.13)

Very simple reproduce steps:
1) Start a server
2) Let 2 players join the server
3) One player then should disconnect
4) There's will be still two players is "entityList"


I didn't researched if it could cause any real problems, but it's definetely a bug
Sorry for my english, i'm not native english speaker

For moderators: I don't know if i'm first who reported bug in code itself, but i think it should be fixed like any other bug