Package org.bukkit.map
Interface MapView
-
public interface MapViewRepresents a map item.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMapView.ScaleAn enum representing all possible scales a map can be set to.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddRenderer(MapRenderer renderer)Add a renderer to this map.intgetCenterX()Get the center X position of this map.intgetCenterZ()Get the center Z position of this map.intgetId()Get the ID of this map item for use withMapMeta.List<MapRenderer>getRenderers()Get a list of MapRenderers currently in effect.MapView.ScalegetScale()Get the scale of this map.WorldgetWorld()Get the world that this map is associated with.booleanisUnlimitedTracking()Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.booleanisVirtual()Check whether this map is virtual.booleanremoveRenderer(MapRenderer renderer)Remove a renderer from this map.voidsetCenterX(int x)Set the center X position of this map.voidsetCenterZ(int z)Set the center Z position of this map.voidsetScale(MapView.Scale scale)Set the scale of this map.voidsetUnlimitedTracking(boolean unlimited)Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.voidsetWorld(World world)Set the world that this map is associated with.
-
-
-
Method Detail
-
getId
int getId()
Get the ID of this map item for use withMapMeta.- Returns:
- The ID of the map.
-
isVirtual
boolean isVirtual()
Check whether this map is virtual. A map is virtual if its lowermost MapRenderer is plugin-provided.- Returns:
- Whether the map is virtual.
-
getScale
@NotNull MapView.Scale getScale()
Get the scale of this map.- Returns:
- The scale of the map.
-
setScale
void setScale(@NotNull MapView.Scale scale)Set the scale of this map.- Parameters:
scale- The scale to set.
-
getCenterX
int getCenterX()
Get the center X position of this map.- Returns:
- The center X position.
-
getCenterZ
int getCenterZ()
Get the center Z position of this map.- Returns:
- The center Z position.
-
setCenterX
void setCenterX(int x)
Set the center X position of this map.- Parameters:
x- The center X position.
-
setCenterZ
void setCenterZ(int z)
Set the center Z position of this map.- Parameters:
z- The center Z position.
-
getWorld
@Nullable World getWorld()
Get the world that this map is associated with. Primarily used by the internal renderer, but may be used by external renderers. May return null if the world the map is associated with is not loaded.- Returns:
- The World this map is associated with.
-
setWorld
void setWorld(@NotNull World world)Set the world that this map is associated with. The world is used by the internal renderer, and may also be used by external renderers.- Parameters:
world- The World to associate this map with.
-
getRenderers
@NotNull List<MapRenderer> getRenderers()
Get a list of MapRenderers currently in effect.- Returns:
- A
List<MapRenderer>containing each map renderer.
-
addRenderer
void addRenderer(@NotNull MapRenderer renderer)Add a renderer to this map.- Parameters:
renderer- The MapRenderer to add.
-
removeRenderer
boolean removeRenderer(@Nullable MapRenderer renderer)Remove a renderer from this map.- Parameters:
renderer- The MapRenderer to remove.- Returns:
- True if the renderer was successfully removed.
-
isUnlimitedTracking
boolean isUnlimitedTracking()
Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.- Returns:
- unlimited tracking state
-
setUnlimitedTracking
void setUnlimitedTracking(boolean unlimited)
Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.- Parameters:
unlimited- tracking state
-
-