Interface MapView


public interface MapView
Represents a map item.
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    An enum representing all possible scales a map can be set to.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    Add a renderer to this map.
    int
    Get the center X position of this map.
    int
    Get the center Z position of this map.
    int
    Get the ID of this map item for use with MapMeta.
    Get a list of MapRenderers currently in effect.
    Get the scale of this map.
    Get the world that this map is associated with.
    boolean
    Gets whether the map is locked or not.
    boolean
    Gets whether a position cursor should be shown when the map is near its center.
    boolean
    Whether the map will show a smaller position cursor (true), or no position cursor (false) when cursor is outside of map's range.
    boolean
    Check whether this map is virtual.
    boolean
    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
    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(World world)
    Set the world that this map is associated with.
  • Method Details Link icon

    • getId Link icon

      int getId()
      Get the ID of this map item for use with MapMeta.
      Returns:
      The ID of the map.
    • isVirtual Link icon

      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 Link icon

      @NotNull MapView.Scale getScale()
      Get the scale of this map.
      Returns:
      The scale of the map.
    • setScale Link icon

      void setScale(@NotNull MapView.Scale scale)
      Set the scale of this map.
      Parameters:
      scale - The scale to set.
    • getCenterX Link icon

      int getCenterX()
      Get the center X position of this map.
      Returns:
      The center X position.
    • getCenterZ Link icon

      int getCenterZ()
      Get the center Z position of this map.
      Returns:
      The center Z position.
    • setCenterX Link icon

      void setCenterX(int x)
      Set the center X position of this map.
      Parameters:
      x - The center X position.
    • setCenterZ Link icon

      void setCenterZ(int z)
      Set the center Z position of this map.
      Parameters:
      z - The center Z position.
    • getWorld Link icon

      @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 Link icon

      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 Link icon

      @NotNull List<MapRenderer> getRenderers()
      Get a list of MapRenderers currently in effect.
      Returns:
      A List<MapRenderer> containing each map renderer.
    • addRenderer Link icon

      void addRenderer(@NotNull MapRenderer renderer)
      Add a renderer to this map.
      Parameters:
      renderer - The MapRenderer to add.
    • removeRenderer Link icon

      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.
    • isTrackingPosition Link icon

      boolean isTrackingPosition()
      Gets whether a position cursor should be shown when the map is near its center.
      Returns:
      tracking status
    • setTrackingPosition Link icon

      void setTrackingPosition(boolean trackingPosition)
      Sets whether a position cursor should be shown when the map is near its center.
      Parameters:
      trackingPosition - tracking status
    • isUnlimitedTracking Link icon

      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 Link icon

      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
    • isLocked Link icon

      boolean isLocked()
      Gets whether the map is locked or not. A locked map may not be explored further.
      Returns:
      lock status
    • setLocked Link icon

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