Per player maps generating a lot of maps..

Discussion in 'Spigot Plugin Development' started by nktfh100, Dec 14, 2019.

  1. So I am making a minigame and at the start of every game every player gets a map (Basically a minimap)
    The problem is that every time I do this a new map gets generated in the world folder
    Is there a better way to do this?
    Code (Text):
    @EventHandler
        public void onMapInitialize(MapInitializeEvent e) {
            MapView mapView = e.getMap();
            mapView.setScale(Scale.CLOSEST);
            mapView.addRenderer(new Renderer());
         
        }
    Code (Text):
    public class Renderer extends MapRenderer {

        @Override
        public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
            mapView.setCenterX(player.getLocation().getBlockX());
            mapView.setCenterZ(player.getLocation().getBlockZ());
            //and some more calculations to add all players in the game
        }

    }
     
    #1 nktfh100, Dec 14, 2019
    Last edited: Dec 14, 2019
  2. I had the same problem. I was advised that I could go the "complicated way" and delete the maps after use.
     
  3. Oh I see.
    Thanks!