mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Fix memory leak caused by mob spawner items
This commit is contained in:
2 files changed
+6
No files matched your search
@@ -328,6 +328,8 @@ public class ClientHandler
|
||||
|
||||
if (!Minecraft.getMinecraft().isSingleplayer())//wait for server to initiate in singleplayer
|
||||
NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~'));
|
||||
|
||||
ItemMobSpawner.clearEntityReferences(world);
|
||||
}
|
||||
|
||||
lastworld = world;
|
||||
|
||||
@@ -96,6 +96,10 @@ public class ItemMobSpawner extends ItemBlock
|
||||
return e;
|
||||
}
|
||||
|
||||
public static void clearEntityReferences(World newWorld) {
|
||||
entityHashMap.values().removeIf(e -> e.worldObj != newWorld);
|
||||
}
|
||||
|
||||
private void setDefaultTag(ItemStack itemstack) {
|
||||
if (!IDtoNameMap.containsKey(itemstack.getItemDamage()))
|
||||
itemstack.setItemDamage(idPig);
|
||||
|
||||
Reference in new issue
Block a user