Ejemplo n.º 1
0
 public MinimapTile get(final Coord c, final MCache.Grid grid, final int seq) {
   Coord key = new Coord(c);
   MinimapTile tile = tiles.get(key);
   if ((tile == null || tile.seq != seq) && (grid != null)) {
     Defer.Future<BufferedImage> f = rendering.get(key);
     if (f == null) {
       f =
           Defer.later(
               new Defer.Callable<BufferedImage>() {
                 @Override
                 public BufferedImage call() {
                   BufferedImage img = renderer.draw(grid.ul, MCache.cmaps);
                   if (Config.minimapEnableSave.get()) store(img, grid.gc);
                   return img;
                 }
               });
       rendering.put(key, f);
     }
     if (f.done()) {
       BufferedImage img = f.get();
       if (tile == null) {
         tile = createTile(key, seq, img);
         tiles.put(key, tile);
       } else {
         tile.img.update(img);
       }
       rendering.remove(key);
     }
   }
   return tile;
 }