ohowe1 / SpectatorModeRewrite

Minecraft plugin that allows players to go into spectator mode but enables admins to prevent features of it.
https://www.spigotmc.org/resources/smp-spectator-mode-1-16-support.77267/
MIT License
17 stars 10 forks source link

Fix logic in unPrepareMobs #52

Closed rgronberg closed 2 years ago

rgronberg commented 2 years ago

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.