Package xyz.jpenilla.squaremap.api
Interface Squaremap
public interface Squaremap
squaremap API
The API allows other plugins on the server integrate with squaremap.
This interface represents the base of the API package. All functions are accessed via this interface.
To start using the API, you need to obtain an instance of this interface. These are registered by the squaremap plugin to the platforms Services Manager. This is the preferred method for obtaining an instance.
For ease of use, an instance can also be obtained from the static
singleton accessor in SquaremapProvider.
-
Method Summary
Modifier and TypeMethodDescriptiongetWorldIfEnabled(@NonNull WorldIdentifier identifier) Get an optional which will either A) Be empty, if the world does not exist, or does not have squaremap enabled B) Contain theMapWorldinstance for the World associated with the providedWorldIdentifier, if the world exists and has squaremap enabledGet anHtmlComponentSerializerusing the platformComponentFlattener.Get the registry of images which can be used with icon markersGet an unmodifiable view of the enabled worldsGet the player managerwebDir()Get the web directory
-
Method Details
-
mapWorlds
@NonNull Collection<MapWorld> mapWorlds()Get an unmodifiable view of the enabled worlds- Returns:
- The set of worlds
-
getWorldIfEnabled
Get an optional which will either- A) Be empty, if the world does not exist, or does not have squaremap enabled
- B) Contain the
MapWorldinstance for the World associated with the providedWorldIdentifier, if the world exists and has squaremap enabled
- Parameters:
identifier- world identifier- Returns:
- optional
-
iconRegistry
@NonNull Registry<BufferedImage> iconRegistry()Get the registry of images which can be used with icon markers- Returns:
- icon registry
-
playerManager
@NonNull PlayerManager playerManager()Get the player manager- Returns:
- player manager
-
webDir
Get the web directory- Returns:
- web directory
-
htmlComponentSerializer
@NonNull HtmlComponentSerializer htmlComponentSerializer()Get anHtmlComponentSerializerusing the platformComponentFlattener.- Returns:
- serializer
- Since:
- 1.2.0
-