Package org.spongepowered.api.map
Interface MapInfo
- All Superinterfaces:
DataHolder
,DataHolder.Mutable
,DataSerializable
,Identifiable
,ValueContainer
Represents data that may be viewed on a
map
.
A MapInfo may be attached to multiple maps.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBannerDecoration
(ServerLocation bannerLocation) Adds the banner at the given location to this map.boolean
Gets whether the suppliedItemStack
is backed by this MapInfo, such that modifications to this MapInfo would affect the supplied stack.Serializes this object into a comprehensibleDataContainer
.Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion
Methods inherited from interface org.spongepowered.api.util.Identifiable
uniqueId
-
Method Details
-
isLinked
Gets whether the suppliedItemStack
is backed by this MapInfo, such that modifications to this MapInfo would affect the supplied stack.This will always return
false
if the suppliedItemStack
is not of typeItemTypes.FILLED_MAP
. -
addBannerDecoration
Adds the banner at the given location to this map. This is equivalent to right clicking a banner in the world with the corresponding map.- Parameters:
bannerLocation
- Location of the banner to add.- Throws:
IllegalArgumentException
- if the given location is not a bannerIllegalArgumentException
- if the given banner
-
toContainer
DataContainer toContainer()Serializes this object into a comprehensibleDataContainer
.This has special behaviour for serializing
MapDecorations
A
MapDecoration
on this MapCanvas is only serialized ifMapDecoration.isPersistent()
returns true. This is because non-persistent MapDecorations belong more to the area than the map itself. If you wish to serialize them anyway, obtain theMapDecorations
usingKeys.MAP_DECORATIONS
and serialize each individually.- Specified by:
toContainer
in interfaceDataSerializable
- Returns:
- A newly created DataContainer
-