Package de.bluecolored.bluemap.api
Interface WebApp
public interface WebApp
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.createImage
(BufferedImage image, String path) Deprecated, for removal: This API element is subject to removal in a future version.You should use thegetWebRoot()
method to create the image-files you need, or store map/marker specific images in the map's storage (See:BlueMapMap.getAssetStorage()
)!boolean
getPlayerVisibility
(UUID player) Returnstrue
if the given player is currently visible on the web-app.Getter for the configured web-root foldervoid
registerScript
(String url) Registers a js-script so the webapp loads it.
This method should only be used inside theConsumer
that got registered (before bluemap loaded, pre server-start!) toBlueMapAPI.onEnable(Consumer)
.
Invoking this method at any other time is not supported.
Script-registrations are not persistent, register your script each time bluemap enables!
Example:void
registerStyle
(String url) Registers a css-style so the webapp loads it.
This method should only be used inside theConsumer
that got registered (before bluemap loaded, pre server-start!) toBlueMapAPI.onEnable(Consumer)
.
Invoking this method at any other time is not supported.
Style-registrations are not persistent, register your style each time bluemap enables!
Example:void
setPlayerVisibility
(UUID player, boolean visible) Shows or hides the given player from being shown on the web-app.
-
Method Details
-
getWebRoot
Path getWebRoot()Getter for the configured web-root folder- Returns:
- The
Path
of the web-root folder
-
setPlayerVisibility
Shows or hides the given player from being shown on the web-app.- Parameters:
player
- the UUID of the playervisible
- true if the player-marker should be visible, false if it should be hidden
-
getPlayerVisibility
Returnstrue
if the given player is currently visible on the web-app.- Parameters:
player
- the UUID of the player- See Also:
-
registerStyle
Registers a css-style so the webapp loads it.
This method should only be used inside theConsumer
that got registered (before bluemap loaded, pre server-start!) toBlueMapAPI.onEnable(Consumer)
.
Invoking this method at any other time is not supported.
Style-registrations are not persistent, register your style each time bluemap enables!
Example:BlueMapAPI.onEnable(api -> { api.getWebApp().registerStyle("js/my-custom-style.css"); });
- Parameters:
url
- The (relative) URL that links to the style.css file. ThegetWebRoot()
-method can be used to create the custom file in the correct location and make it available to the web-app.
-
registerScript
Registers a js-script so the webapp loads it.
This method should only be used inside theConsumer
that got registered (before bluemap loaded, pre server-start!) toBlueMapAPI.onEnable(Consumer)
.
Invoking this method at any other time is not supported.
Script-registrations are not persistent, register your script each time bluemap enables!
Example:BlueMapAPI.onEnable(api -> { api.getWebApp().registerScript("js/my-custom-script.js"); });
- Parameters:
url
- The (relative) URL that links to the script.js file. ThegetWebRoot()
-method can be used to create the custom file in the correct location and make it available to the web-app.
-
createImage
@Deprecated(forRemoval=true) String createImage(BufferedImage image, String path) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.You should use thegetWebRoot()
method to create the image-files you need, or store map/marker specific images in the map's storage (See:BlueMapMap.getAssetStorage()
)!- Throws:
IOException
-
availableImages
Deprecated, for removal: This API element is subject to removal in a future version.You should use thegetWebRoot()
method to find the image-files you need, or read map/marker specific images from the map's storage (See:BlueMapMap.getAssetStorage()
)!- Throws:
IOException
-
getWebRoot()
method to find the image-files you need, or read map/marker specific images from the map's storage (See:BlueMapMap.getAssetStorage()
)!