程序包 org.bukkit.map

# 接口 MapView

public interface MapView
Represents a map item.

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  接口
  说明
  `static enum`
  `MapView.Scale`
  An enum representing all possible scales a map can be set to.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `void`
  `addRenderer(@NotNull MapRenderer renderer)`
  Add a renderer to this map.
  `int`
  `getCenterX()`
  Get the center X position of this map.
  `int`
  `getCenterZ()`
  Get the center Z position of this map.
  `int`
  `getId()`
  Get the ID of this map item for use with `MapMeta`.
  `@NotNull List<MapRenderer>`
  `getRenderers()`
  Get a list of MapRenderers currently in effect.
  `@NotNull MapView.Scale`
  `getScale()`
  Get the scale of this map.
  `@Nullable World`
  `getWorld()`
  Get the world that this map is associated with.
  `boolean`
  `isLocked()`
  Gets whether the map is locked or not.
  `boolean`
  `isTrackingPosition()`
  Gets whether a position cursor should be shown when the map is near its center.
  `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.
  `boolean`
  `isVirtual()`
  Check whether this map is virtual.
  `boolean`
  `removeRenderer(@Nullable MapRenderer renderer)`
  Remove a renderer from this map.
  `void`
  `setCenterX(int x)`
  Set the center X position of this map.
  `void`
  `setCenterZ(int z)`
  Set the center Z position of this map.
  `void`
  `setLocked(boolean locked)`
  Gets whether the map is locked or not.
  `void`
  `setScale(@NotNull MapView.Scale scale)`
  Set the scale of this map.
  `void`
  `setTrackingPosition(boolean trackingPosition)`
  Sets whether a position cursor should be shown when the map is near its center.
  `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.
  `void`
  `setWorld(@NotNull World world)`
  Set the world that this map is associated with.

- ## 方法详细资料

  - ### getId

    int getId()
    Get the ID of this map item for use with `MapMeta`.
    返回:
      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.
    返回:
      Whether the map is virtual.

  - ### getScale

    @NotNull @NotNull MapView.Scale getScale()
    Get the scale of this map.
    返回:
      The scale of the map.

  - ### setScale

    void setScale(@NotNull @NotNull MapView.Scale scale)
    Set the scale of this map.
    参数:
      `scale` - The scale to set.

  - ### getCenterX

    int getCenterX()
    Get the center X position of this map.
    返回:
      The center X position.

  - ### getCenterZ

    int getCenterZ()
    Get the center Z position of this map.
    返回:
      The center Z position.

  - ### setCenterX

    void setCenterX(int x)
    Set the center X position of this map.
    参数:
      `x` - The center X position.

  - ### setCenterZ

    void setCenterZ(int z)
    Set the center Z position of this map.
    参数:
      `z` - The center Z position.

  - ### getWorld

    @Nullable @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.
    返回:
      The World this map is associated with.

  - ### setWorld

    void setWorld(@NotNull @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.
    参数:
      `world` - The World to associate this map with.

  - ### getRenderers

    @NotNull @NotNull List<MapRenderer> getRenderers()
    Get a list of MapRenderers currently in effect.
    返回:
      A `List<MapRenderer>` containing each map renderer.

  - ### addRenderer

    void addRenderer(@NotNull @NotNull MapRenderer renderer)
    Add a renderer to this map.
    参数:
      `renderer` - The MapRenderer to add.

  - ### removeRenderer

    boolean removeRenderer(@Nullable @Nullable MapRenderer renderer)
    Remove a renderer from this map.
    参数:
      `renderer` - The MapRenderer to remove.
    返回:
      True if the renderer was successfully removed.

  - ### isTrackingPosition

    boolean isTrackingPosition()
    Gets whether a position cursor should be shown when the map is near its center.
    返回:
      tracking status

  - ### setTrackingPosition

    void setTrackingPosition(boolean trackingPosition)
    Sets whether a position cursor should be shown when the map is near its center.
    参数:
      `trackingPosition` - tracking status

  - ### 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.
    返回:
      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.
    参数:
      `unlimited` - tracking state

  - ### isLocked

    boolean isLocked()
    Gets whether the map is locked or not. A locked map may not be explored further.
    返回:
      lock status

  - ### setLocked

    void setLocked(boolean locked)
    Gets whether the map is locked or not. A locked map may not be explored further.
    参数:
      `locked` - status