Spawners, variables and active mobs should be saved asynchronously
Summary
Atm data is saved to files on the main server thread, this causes lag spikes on servers with a lot of mobs and spawners.
Priority
This is an important enhancement for large servers.
Implementation
I injected a custom implementation using RuntimeTransformer as a proof of concept:
public final class MythicMobsFixes extends JavaPlugin {
@Override
public void onLoad() {
List<Class<?>> transformers = new ArrayList<>();
transformers.add(MobManagerTransformer.class);
transformers.add(SpawnerManagerTransformer.class);
new RuntimeTransformer(transformers.toArray(new Class<?>[0]));
}
@Override
public void onEnable() {
Executors.getInstance(); // Cache executors
}
@Override
public void onDisable() {
Executors.shutdown();
}
}