Interface WebApp


public interface WebApp
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    You should use the getWebRoot() method to find the image-files you need, or read map/marker specific images from the map's storage (See: BlueMapMap.getAssetStorage())!
    Deprecated, for removal: This API element is subject to removal in a future version.
    You should use the getWebRoot() method to create the image-files you need, or store map/marker specific images in the map's storage (See: BlueMapMap.getAssetStorage())!
    boolean
    Returns true if the given player is currently visible on the web-app.
    Getter for the configured web-root folder
    void
    Registers a js-script so the webapp loads it.
    This method should only be used inside the Consumer that got registered (before bluemap loaded, pre server-start!) to BlueMapAPI.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
    Registers a css-style so the webapp loads it.
    This method should only be used inside the Consumer that got registered (before bluemap loaded, pre server-start!) to BlueMapAPI.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

      void setPlayerVisibility(UUID player, boolean visible)
      Shows or hides the given player from being shown on the web-app.
      Parameters:
      player - the UUID of the player
      visible - true if the player-marker should be visible, false if it should be hidden
    • getPlayerVisibility

      boolean getPlayerVisibility(UUID player)
      Returns true if the given player is currently visible on the web-app.
      Parameters:
      player - the UUID of the player
      See Also:
    • registerStyle

      void registerStyle(String url)
      Registers a css-style so the webapp loads it.
      This method should only be used inside the Consumer that got registered (before bluemap loaded, pre server-start!) to BlueMapAPI.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. The getWebRoot()-method can be used to create the custom file in the correct location and make it available to the web-app.
    • registerScript

      void registerScript(String url)
      Registers a js-script so the webapp loads it.
      This method should only be used inside the Consumer that got registered (before bluemap loaded, pre server-start!) to BlueMapAPI.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. The getWebRoot()-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 the getWebRoot() 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(forRemoval=true) Map<String,String> availableImages() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      You should use the getWebRoot() method to find the image-files you need, or read map/marker specific images from the map's storage (See: BlueMapMap.getAssetStorage())!
      Throws:
      IOException