@Override public MapTile[] getTiles(Location loc) { DynmapWorld world = MapManager.mapman.getWorld(loc.getWorld().getName()); HashSet<MapTile> tiles = new HashSet<MapTile>(); Vector3D block = new Vector3D(); block.setFromLocation(loc); /* Get coordinate for block */ Vector3D corner = new Vector3D(); /* Loop through corners of the cube */ for (int i = 0; i < 2; i++) { double inity = block.y; for (int j = 0; j < 2; j++) { double initz = block.z; for (int k = 0; k < 2; k++) { world_to_map.transform(block, corner); /* Get map coordinate of corner */ addTile( tiles, world, (int) Math.floor(corner.x / tileWidth), (int) Math.floor(corner.y / tileHeight)); block.z += 1; } block.z = initz; block.y += 1; } block.y = inity; block.x += 1; } return tiles.toArray(new MapTile[tiles.size()]); }