From 31173a1fbd249ce4adaad75feb52b64b33c0daea Mon Sep 17 00:00:00 2001 From: Glease <4586901+Glease@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:11:52 +0800 Subject: [PATCH] fix memory leak fixes not working for MP (#590) #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 --- src/main/java/codechicken/nei/ClientHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/codechicken/nei/ClientHandler.java b/src/main/java/codechicken/nei/ClientHandler.java index 50078c81f..6e51761e4 100644 --- a/src/main/java/codechicken/nei/ClientHandler.java +++ b/src/main/java/codechicken/nei/ClientHandler.java @@ -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; }