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 TypeMethodDescriptionvoidaddBannerDecoration(ServerLocation bannerLocation) Adds the banner at the given location to this map.booleanGets whether the suppliedItemStackis 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, undoMethods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersionMethods inherited from interface org.spongepowered.api.util.Identifiable
uniqueId
-
Method Details
-
isLinked
Gets whether the suppliedItemStackis backed by this MapInfo, such that modifications to this MapInfo would affect the supplied stack.This will always return
falseif the suppliedItemStackis 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
MapDecorationsA
MapDecorationon 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 theMapDecorationsusingKeys.MAP_DECORATIONSand serialize each individually.- Specified by:
toContainerin interfaceDataSerializable- Returns:
- A newly created DataContainer
-