Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
MapView.java
1 package org.bukkit.map;
2 
3 import java.util.List;
4 import org.bukkit.World;
5 
6 /**
7  * Represents a map item.
8  */
9 public interface MapView {
10 
11  /**
12  * An enum representing all possible scales a map can be set to.
13  */
14  public static enum Scale {
15  CLOSEST(0),
16  CLOSE(1),
17  NORMAL(2),
18  FAR(3),
19  FARTHEST(4);
20 
21  private byte value;
22 
23  private Scale(int value) {
24  this.value = (byte) value;
25  }
26 
27  /**
28  * Get the scale given the raw value.
29  *
30  * @param value The raw scale
31  * @return The enum scale, or null for an invalid input
32  * @deprecated Magic value
33  */
34  @Deprecated
35  public static Scale valueOf(byte value) {
36  switch (value) {
37  case 0: return CLOSEST;
38  case 1: return CLOSE;
39  case 2: return NORMAL;
40  case 3: return FAR;
41  case 4: return FARTHEST;
42  default: return null;
43  }
44  }
45 
46  /**
47  * Get the raw value of this scale level.
48  *
49  * @return The scale value
50  * @deprecated Magic value
51  */
52  @Deprecated
53  public byte getValue() {
54  return value;
55  }
56  }
57 
58  /**
59  * Get the ID of this map item. Corresponds to the damage value of a map
60  * in an inventory.
61  *
62  * @return The ID of the map.
63  * @deprecated Magic value
64  */
65  @Deprecated
66  public short getId();
67 
68  /**
69  * Check whether this map is virtual. A map is virtual if its lowermost
70  * MapRenderer is plugin-provided.
71  *
72  * @return Whether the map is virtual.
73  */
74  public boolean isVirtual();
75 
76  /**
77  * Get the scale of this map.
78  *
79  * @return The scale of the map.
80  */
81  public Scale getScale();
82 
83  /**
84  * Set the scale of this map.
85  *
86  * @param scale The scale to set.
87  */
88  public void setScale(Scale scale);
89 
90  /**
91  * Get the center X position of this map.
92  *
93  * @return The center X position.
94  */
95  public int getCenterX();
96 
97  /**
98  * Get the center Z position of this map.
99  *
100  * @return The center Z position.
101  */
102  public int getCenterZ();
103 
104  /**
105  * Set the center X position of this map.
106  *
107  * @param x The center X position.
108  */
109  public void setCenterX(int x);
110 
111  /**
112  * Set the center Z position of this map.
113  *
114  * @param z The center Z position.
115  */
116  public void setCenterZ(int z);
117 
118  /**
119  * Get the world that this map is associated with. Primarily used by the
120  * internal renderer, but may be used by external renderers. May return
121  * null if the world the map is associated with is not loaded.
122  *
123  * @return The World this map is associated with.
124  */
125  public World getWorld();
126 
127  /**
128  * Set the world that this map is associated with. The world is used by
129  * the internal renderer, and may also be used by external renderers.
130  *
131  * @param world The World to associate this map with.
132  */
133  public void setWorld(World world);
134 
135  /**
136  * Get a list of MapRenderers currently in effect.
137  *
138  * @return A List<MapRenderer> containing each map renderer.
139  */
140  public List<MapRenderer> getRenderers();
141 
142  /**
143  * Add a renderer to this map.
144  *
145  * @param renderer The MapRenderer to add.
146  */
147  public void addRenderer(MapRenderer renderer);
148 
149  /**
150  * Remove a renderer from this map.
151  *
152  * @param renderer The MapRenderer to remove.
153  * @return True if the renderer was successfully removed.
154  */
155  public boolean removeRenderer(MapRenderer renderer);
156 
157 }
List< MapRenderer > getRenderers()
void addRenderer(MapRenderer renderer)
void setCenterX(int x)
void setScale(Scale scale)
void setWorld(World world)
boolean removeRenderer(MapRenderer renderer)
void setCenterZ(int z)