The config check in unPrepareMobs was the inverse of prepareMobs, so
saved mobs were getting setRemoveWhenFarAway(false), but were never
getting set back to setRemoveWhenFarAway(true) when exiting spectator
mode. This was causing hundreds and hundreds of persistent mobs to
accumulate and bog down the server.
This does not remove mobs that have been persisted in the past, but
will prevent new persistent mobs.
The config check in unPrepareMobs was the inverse of prepareMobs, so saved mobs were getting setRemoveWhenFarAway(false), but were never getting set back to setRemoveWhenFarAway(true) when exiting spectator mode. This was causing hundreds and hundreds of persistent mobs to accumulate and bog down the server.
This does not remove mobs that have been persisted in the past, but will prevent new persistent mobs.