1.15.2 Looking for the "best" way to inject MapRenderer's on server startup

Discussion in 'Spigot Plugin Development' started by _Ross__, Jan 11, 2020.

  1. I've created a library to bring in images and tileize them into custom maps and everything is working fine... until I restart the server then the maps are blank (which is to be expected per-spigots behavior).

    I've tried using MapInitializeEvent to restore my custom renderer on server-start but it doesn't work (the maps are still blank). So I've fallen back to using Bukkit.getMap(id) and injecting my renderer into its result and this works - but it feels like the wrong solution as it forces loading all custom map images and data on startup which isn't strictly necessary as only maps in force-loaded chunks or in view of player need to be loaded.

    So, my question is, what is the "best" way to setup custom map renderer's when the server starts up?
  2. Do you have any code to show?