-
Bug
-
Resolution: Fixed
-
Minecraft 1.9.2, Minecraft 1.11.2, Minecraft 1.12.2, Minecraft 18w15a, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w30b
-
Confirmed
-
(Unassigned)
Note
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
The bug
The field net.minecraft.block.BlockRedstoneTorch.toggles is a map with Worlds (like Overworld, End and Nether) as key and a list of redstone torch states as value. The problem is that a world is never removed from this list, which means that all save files you load containing redstone torches that burned out have still a reference in this list and cannot be collected by the garbage collection.
In general it might be better to use a TileEntity to store this value. But I am not too familiar with what effect this would have on performance.
pokechu22: Alternatively, using a WeakHashMap would also solve this, as it would allow the World to be collected without having to do any extra work.