-
Notifications
You must be signed in to change notification settings - Fork 13
Plans for a partial rewrite #21
Description
Now that BlueMap's API has drastically changed, there are a few things about the design of the plugin that just don't seem necessary anymore, especially related to the core module and its communication with the addons.
A list of things that were once necessary but are now just confusing, limiting or even adding computational overhead (might be expanded):
Region Snapshots
Region snapshots were necessary because in API v1, it was beneficial to collect as many marker updates as possible before actually applying them. You also couldn't create any Marker instances in advance and save them for later, because they had to be linked to a MarkerAPI instance.
Just letting the addons generate Marker objects directly would not only remove an unnecessary class but it would also allow for any of BlueMap's current or future marker types to be used by addons.
The update task
The global update task was a performance benefit for the same reasons stated above: It allowed to update all markers of all addons in just one IO operation.
Now that that is completely irrelevant, addons can just notify the core module, if there are changes. Similar to how "active" addons are currently doing it but the markers would also be able to update instantly. That way, addons that benefit from region/claim modification events (currently GriefPrevention) can still use the events in the same way while passive addons that were previously polled in regular intervals could just schedule their own repeating tasks using the same entry point in the core module.
Filtering marker changes
Also related to the IO changes, it is no longer beneficial to filter which regions have actually changed before applying the markers.
Just replacing a marker instance with the updated one and ignoring their content is most likely not slower than comparing each marker with its old instance before replacing it. BlueMap now serializes the entire marker map in regular intervals, so this computation can't be sped up by minimizing updates anyways.