Skip to content
Lukas Rieger edited this page Oct 5, 2020 · 28 revisions

Preparations

Gradle/Maven

If you are using gradle or maven you can use JitPack to add BlueMapAPI to your project.

Manually

Otherwise you can download the version you want from the releases and include that into your build-path, you will then also need to add the dependency com.flowpowered/flow-math/1.0.3 to your build-path.

API entry-point

Javadoc: https://bluecolored.de/bluemapapi/

The BlueMapAPI class has some static methods that will be your entry-point into the API:

// Directly getting the api
Optional<BlueMapAPI> api = BlueMapAPI.getInstance();

// Using a listener to do something as soon as the API is available
BlueMapAPI.onEnable(api -> {
   //code executed when the api got enabled
});

BlueMapAPI.onDisable(api -> {
   //code executed right before the api gets disabled
});

Using the MarkerAPI

If you want to use the MarkerAPI, you start by loading a MakerAPI instance:

MarkerAPI markerApi = blueMapApi.getMarkerAPI();

You need to understand that each time you are calling getMarkerAPI() a new MarkerAPI instance is created and loaded! So only do this once and use this instance to create all you markers. After creating all the markers you need to call

markerApi.save();

to save your changes to the markers.json.

Clone this wiki locally