Package de.bluecolored.bluemap.api
Interface BlueMapMap
public interface BlueMapMap
This class represents a map that is rendered by BlueMap of a specific world (
BlueMapWorld
).
Each map belongs to a map configured in BlueMap's configuration file (in the maps: []
list).-
Method Summary
Modifier and TypeMethodDescriptionGetter for this map'sAssetStorage
.getId()
Returns this maps id, this is equal to the id configured in bluemap's config for this map.getName()
Returns this maps display-name, this is equal to the name configured in bluemap's config for this map.Returns the currently set TileFilter.Getter for the offset of the tile-grid on this map.
E.g.Getter for the size of all tiles on this map in blocks.getWorld()
Getter for theBlueMapWorld
of this map.boolean
isFrozen()
Checks if the map is currently frozendefault Vector2i
posToTile
(double blockX, double blockZ) Converts a block-position to a map-tile-coordinate for this mapdefault Vector2i
Converts a block-position to a map-tile-coordinate for this mapdefault Vector2i
Converts a block-position to a map-tile-coordinate for this mapvoid
setFrozen
(boolean frozen) Freezes or unfreezes the map in the same way the `/bluemap freeze` command does.void
setTileFilter
(Predicate<Vector2i> filter) Sets a filter that determines if a specific (hires) tile of this map should be updated or not.
-
Method Details
-
getId
String getId()Returns this maps id, this is equal to the id configured in bluemap's config for this map.- Returns:
- the id of this map
-
getName
String getName()Returns this maps display-name, this is equal to the name configured in bluemap's config for this map.- Returns:
- the name of this map
-
getWorld
BlueMapWorld getWorld()Getter for theBlueMapWorld
of this map.- Returns:
- the
BlueMapWorld
of this map
-
getAssetStorage
AssetStorage getAssetStorage()Getter for this map'sAssetStorage
.
Each map has its own storage for assets. Assets that are stored here will be available to every webapp that is displaying this map. E.g. these assets are also available in server-networks.- Returns:
- the
AssetStorage
of this map
-
getMarkerSets
-
getTileSize
Vector2i getTileSize()Getter for the size of all tiles on this map in blocks.- Returns:
- the tile-size in blocks
-
getTileOffset
Vector2i getTileOffset()Getter for the offset of the tile-grid on this map.
E.g. an offset of (2|-1) would mean that the tile (0|0) has block (2|0|-1) at it's min-corner.- Returns:
- the tile-offset in blocks
-
setTileFilter
Sets a filter that determines if a specific (hires) tile of this map should be updated or not. If this filter returns false for a tile, the "render"-process of this tile will be cancelled and the tile will be left untouched.
Warning: Using this method will harm the integrity of the map! Since BlueMap will still assume that the tile got updated properly.
Any previously set filters will get overwritten with the new one. You can get the current filter using
getTileFilter()
and combine them if you wish.- Parameters:
filter
- The filter that will be used from now on.
-
setFrozen
void setFrozen(boolean frozen) Freezes or unfreezes the map in the same way the `/bluemap freeze` command does. BlueMap will no longer attempt to update this map if it is frozen.- Parameters:
frozen
- Whether the map will be frozen or not
-
isFrozen
boolean isFrozen()Checks if the map is currently frozen- Returns:
- true if the map is frozen, false otherwise
-
getTileFilter
Returns the currently set TileFilter. The default TileFilter is equivalent tot -> true
. -
posToTile
Converts a block-position to a map-tile-coordinate for this map- Parameters:
blockX
- the x-position of the blockblockZ
- the z-position of the block- Returns:
- the tile position
-
posToTile
Converts a block-position to a map-tile-coordinate for this map- Parameters:
pos
- the position of the block- Returns:
- the tile position
-
posToTile
Converts a block-position to a map-tile-coordinate for this map- Parameters:
pos
- the position of the block- Returns:
- the tile position
-