Class MapViewBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.helper.MapViewBuilder
The
MapViewBuilder class allows for configuring MapView properties,
such as center coordinates, scale, world, and renderers.-
Constructor Summary
ConstructorsConstructorDescriptionMapViewBuilder(@NotNull org.bukkit.map.MapView mapView) Constructs aMapViewBuilderfor the givenMapView. -
Method Summary
Modifier and TypeMethodDescriptionaddRenderer(@NotNull org.bukkit.map.MapRenderer renderer) Adds a renderer to the map.org.bukkit.map.MapViewbuild()Gets the configuredMapView.removeRenderer(@NotNull org.bukkit.map.MapRenderer renderer) Removes a renderer from the map.setCenterX(int x) Sets the center X coordinate of the map.setCenterZ(int z) Sets the center Z coordinate of the map.setLocked(boolean locked) Sets whether the map is locked.setScale(org.bukkit.map.MapView.Scale scale) Sets the scale of the map.setTrackingPosition(boolean tracking) Sets whether the map should track player positions.setUnlimitedTracking(boolean unlimited) Sets whether the map has unlimited tracking.setWorld(@NotNull org.bukkit.World world) Sets the world the map is associated with.
-
Constructor Details
-
MapViewBuilder
public MapViewBuilder(@NotNull @NotNull org.bukkit.map.MapView mapView) Constructs aMapViewBuilderfor the givenMapView.- Parameters:
mapView- the map view to configure
-
-
Method Details
-
setCenterX
Sets the center X coordinate of the map.- Parameters:
x- the center X position- Returns:
- this
MapViewBuilderinstance for chaining
-
setCenterZ
Sets the center Z coordinate of the map.- Parameters:
z- the center Z position- Returns:
- this
MapViewBuilderinstance for chaining
-
setWorld
Sets the world the map is associated with.- Parameters:
world- the world- Returns:
- this
MapViewBuilderinstance for chaining
-
setScale
Sets the scale of the map.- Parameters:
scale- the map's scale- Returns:
- this
MapViewBuilderinstance for chaining
-
setLocked
Sets whether the map is locked.- Parameters:
locked- true to lock the map, false to unlock- Returns:
- this
MapViewBuilderinstance for chaining
-
setTrackingPosition
Sets whether the map should track player positions.- Parameters:
tracking- true to track player positions, false otherwise- Returns:
- this
MapViewBuilderinstance for chaining
-
setUnlimitedTracking
Sets whether the map has unlimited tracking.- Parameters:
unlimited- true to enable unlimited tracking, false otherwise- Returns:
- this
MapViewBuilderinstance for chaining
-
addRenderer
Adds a renderer to the map.- Parameters:
renderer- theMapRendererto add- Returns:
- this
MapViewBuilderinstance for chaining
-
removeRenderer
Removes a renderer from the map.- Parameters:
renderer- theMapRendererto remove- Returns:
- this
MapViewBuilderinstance for chaining
-
build
public org.bukkit.map.MapView build()Gets the configuredMapView.- Returns:
- the configured map view
-