Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
MapRenderer.java
1 package org.bukkit.map;
2 
3 import org.bukkit.entity.Player;
4 
5 /**
6  * Represents a renderer for a map.
7  */
8 public abstract class MapRenderer {
9 
10  private boolean contextual;
11 
12  /**
13  * Initialize the map renderer base to be non-contextual. See {@link
14  * #isContextual()}.
15  */
16  public MapRenderer() {
17  this(false);
18  }
19 
20  /**
21  * Initialize the map renderer base with the given contextual status.
22  *
23  * @param contextual Whether the renderer is contextual. See {@link
24  * #isContextual()}.
25  */
26  public MapRenderer(boolean contextual) {
27  this.contextual = contextual;
28  }
29 
30  /**
31  * Get whether the renderer is contextual, i.e. has different canvases for
32  * different players.
33  *
34  * @return True if contextual, false otherwise.
35  */
36  final public boolean isContextual() {
37  return contextual;
38  }
39 
40  /**
41  * Initialize this MapRenderer for the given map.
42  *
43  * @param map The MapView being initialized.
44  */
45  public void initialize(MapView map) {}
46 
47  /**
48  * Render to the given map.
49  *
50  * @param map The MapView being rendered to.
51  * @param canvas The canvas to use for rendering.
52  * @param player The player who triggered the rendering.
53  */
54  abstract public void render(MapView map, MapCanvas canvas, Player player);
55 
56 }
final boolean isContextual()
void initialize(MapView map)
abstract void render(MapView map, MapCanvas canvas, Player player)
MapRenderer(boolean contextual)