Default MapRenderer

Discussion in 'Spigot Plugin Development' started by BananaPuncher714, May 28, 2017.

  1. So I am making a plugin where changing the map scale then drawing ALL the blocks on it is very important. How do I refresh the entire map, so that all the blocks on a map get redrawn? I searched google many times, and there is nothing about this. I would prefer not having to recode the default renderer, so I came here to see if anyone else could help me.
     
  2. Just replace the image part and use something like this:
    mapCanvas.getCursors().getCursor(0).setX();
    mapCanvas.getCursors().getCursor(0).setY();
     
  3. Yes, but what would that do? All it does is move a cursor around. Does that refresh the map?
     
  4. In my Marauders Map plugin, that was the render I used to move the map around along with the player head's image. I'm not exactly sure how I got that effect but I know that render does what you want xD.
     
  5. Or, what I mean to say is, "Is there a way to change the map update radius?"
     
  6. You could try removing the map in the players current hand and replace it with another one.
     
  7. The default update radius of the player does not cover the entire map. Doing that would not update the blank spots, which is what I need filled in. Maybe there is a way to change the default update radius?
     
  8. Do you have any code that you could share?
     
  9. This is the only code I have pertaining to maps:
    Code (Java):
        short d = map.getDurability();
         MapView mv = plugin.getServer().getMap( d );
         mv.setCenterX( p.getLocation().getBlockX() );
         mv.setCenterZ( p.getLocation().getBlockZ() );
         Scale s = mv.getScale();
         if ( s.equals( Scale.CLOSE ) ) {
           if ( !zoom ) mv.setScale( Scale.NORMAL );
         } else if ( s.equals( Scale.NORMAL ) ) {
           if ( zoom ) mv.setScale( Scale.CLOSE );
           else mv.setScale( Scale.FAR );
         } else if ( s.equals( Scale.FAR ) ) {
           if ( zoom ) mv.setScale( Scale.NORMAL );
         } else {
           mv.setScale( Scale.NORMAL );
         }
         p.sendMessage( mv.getScale().toString() );
         return mv;
    I don't have any renderers because I don't want to re-write a renderer to draw each block that matches up to this chart: http://minecraft.gamepedia.com/Map_item_format#Color_table
     
  10. After you setScale, try doing mv.setWorld(playersWorld).
     
  11. Ok, I will try that, but I don't see what that will do for my map... I don't think it changes the update radius.