-
Notifications
You must be signed in to change notification settings - Fork 4
Home
- Allows you to spawn mobs from spawners under any conditions
- Uses vanilla mob spawners, does not modify them (except for optional naming)
First, any existing mob spawners are discovered in the world. This is done when a chunk is loaded into memory and when a player places a mob spawner. SpawnerControl tracks the locations of these spawners. If a discovered spawner meets the criteria as defined in the configuration, then it becomes active. When a spawner is active then it runs custom code which mimics vanilla mob spawner behavior but it ignores things such as light level, mob spawning rules, etc.
SpawnerControl has been designed with performance in mind. When possible everything is done asynchronously. However, there are some things that must be done synchronously with the main thread, most notably chunk load enumerating. This enacts a small performance penalty on chunk loads, but other than that performance degradation should be minimal.
Discovered spawners are cached when the chunk is loaded. When the chunk is eventually unloaded then loaded again, it doesn't need to be enumerated again since the spawners in that chunk were previously cached. When a chunk with active spawners is unloaded, SpawnerControl deactivates them.