Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 132
    • Issues 132
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Issues
  • #144

Closed
Open
Created Oct 16, 2020 by Gabriele C.@sgdc3

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:

  • https://pastebin.com/medUVdLT
  • https://pastebin.com/Kh9SaRHQ
  • https://pastebin.com/vK8L2V0Q
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();
    }
}
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking