Package org.bukkit.inventory.meta

# Interface MapMeta

All Superinterfaces:
  `Cloneable`, `ConfigurationSerializable`, `ItemMeta`, `PersistentDataHolder`

public interface MapMeta extends ItemMeta
Represents a map that can be scalable.

## Method Summary

Modifier and Type
Method
Description
`@NotNull MapMeta`
`clone()`
`@Nullable Color`
`getColor()`
Gets the map color that is set.
`@Nullable String`
`getLocationName()`
Gets the location name that is set.
`int`
`getMapId()`
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID).
`@Nullable MapView`
`getMapView()`
Gets the map view that is associated with this map item.
`boolean`
`hasColor()`
Checks for existence of a map color.
`boolean`
`hasLocationName()`
Checks for existence of a location name.
`boolean`
`hasMapId()`
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID).
`boolean`
`hasMapView()`
Checks for existence of an associated map.
`boolean`
`isScaling()`
Checks to see if this map is scaling.
`void`
`setColor(@Nullable Color color)`
Sets the map color.
`void`
`setLocationName(@Nullable String name)`
Sets the location name.
`void`
`setMapId(int id)`
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID).
`void`
`setMapView(MapView map)`
Sets the associated map.
`void`
`setScaling(boolean value)`
Sets if this map is scaling or not.

### Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable

`serialize`

### Methods inherited from interface org.bukkit.inventory.meta.ItemMeta

`addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getLoreComponents, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setLocalizedName, setLore, setLoreComponents, setPlaceableKeys, setUnbreakable, setVersion`

### Methods inherited from interface org.bukkit.persistence.PersistentDataHolder

`getPersistentDataContainer`

## Method Details

### hasMapId

@Deprecated boolean hasMapId()
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID). The xxxMapView family of methods should be used instead.
Checks for existence of a map ID number.

Returns:
  true if this has a map ID number.
See Also:
  - `hasMapView()`

### getMapId

@Deprecated int getMapId()
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID). The xxxMapView family of methods should be used instead.
Gets the map ID that is set. This is used to determine what map is displayed.

Plugins should check that hasMapId() returns `true` before calling this method.

Returns:
  the map ID that is set
See Also:
  - `getMapView()`

### setMapId

@Deprecated void setMapId(int id)
Deprecated.
These methods are poor API: They rely on the caller to pass in an only an integer property, and have poorly defined implementation behavior if that integer is not a valid map (the current implementation for example will generate a new map with a different ID). The xxxMapView family of methods should be used instead.
Sets the map ID. This is used to determine what map is displayed.

Parameters:
  `id` - the map id to set
See Also:
  - `setMapView(org.bukkit.map.MapView)`

### hasMapView

boolean hasMapView()
Checks for existence of an associated map.

Returns:
  true if this item has an associated map

### getMapView

@Nullable @Nullable MapView getMapView()
Gets the map view that is associated with this map item.

Plugins should check that hasMapView() returns `true` before calling this method.

Returns:
  the map view, or null if the item hasMapView(), but this map does not exist on the server

### setMapView

void setMapView(MapView map)
Sets the associated map. This is used to determine what map is displayed.

The implementation may allow null to clear the associated map, but this is not required and is liable to generate a new (undefined) map when the item is first used.

Parameters:
  `map` - the map to set

### isScaling

boolean isScaling()
Checks to see if this map is scaling.

Returns:
  true if this map is scaling

### setScaling

void setScaling(boolean value)
Sets if this map is scaling or not.

Parameters:
  `value` - true to scale

### hasLocationName

boolean hasLocationName()
Checks for existence of a location name.

Returns:
  true if this has a location name

### getLocationName

@Nullable @Nullable String getLocationName()
Gets the location name that is set.

Plugins should check that hasLocationName() returns `true` before calling this method.

Returns:
  the location name that is set

### setLocationName

void setLocationName(@Nullable @Nullable String name)
Sets the location name. A custom map color will alter the display of the map in an inventory slot.

Parameters:
  `name` - the name to set

### hasColor

boolean hasColor()
Checks for existence of a map color.

Returns:
  true if this has a custom map color

### getColor

@Nullable @Nullable Color getColor()
Gets the map color that is set. A custom map color will alter the display of the map in an inventory slot.

Plugins should check that hasColor() returns `true` before calling this method.

Returns:
  the map color that is set

### setColor

void setColor(@Nullable @Nullable Color color)
Sets the map color. A custom map color will alter the display of the map in an inventory slot.

Parameters:
  `color` - the color to set

### clone

@NotNull @NotNull MapMeta clone()

Specified by:
  `clone` in interface `ItemMeta`