Skip to content

Commit

Permalink
fix memory leak fixes not working for MP (GTNewHorizons#590)
Browse files Browse the repository at this point in the history
GTNewHorizons#258 addresses the memory leak in ItemMobSpawner. Unfortunately the clean up handler is not consistently called on every world unloaded. This PR fixes this issue by moving the call out of that if block

(cherry picked from commit 31173a1)
  • Loading branch information
Glease authored and ChrisJStone committed Jan 10, 2025
1 parent e19a4e8 commit 6e7a3bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/codechicken/nei/ClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,8 @@ public void loadWorld(World world, boolean fromServer) {

if (!Minecraft.getMinecraft().isSingleplayer()) // wait for server to initiate in singleplayer
NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~'));

ItemMobSpawner.clearEntityReferences(world);
}
ItemMobSpawner.clearEntityReferences(world);

lastworld = world;
}
Expand Down

0 comments on commit 6e7a3bb

Please sign in to comment.