Class MapViewBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.helper.MapViewBuilder

public class MapViewBuilder extends Object
The MapViewBuilder class allows for configuring MapView properties, such as center coordinates, scale, world, and renderers.
  • Constructor Details

    • MapViewBuilder

      public MapViewBuilder(@NotNull @NotNull org.bukkit.map.MapView mapView)
      Constructs a MapViewBuilder for the given MapView.
      Parameters:
      mapView - the map view to configure
  • Method Details

    • setCenterX

      public MapViewBuilder setCenterX(int x)
      Sets the center X coordinate of the map.
      Parameters:
      x - the center X position
      Returns:
      this MapViewBuilder instance for chaining
    • setCenterZ

      public MapViewBuilder setCenterZ(int z)
      Sets the center Z coordinate of the map.
      Parameters:
      z - the center Z position
      Returns:
      this MapViewBuilder instance for chaining
    • setWorld

      public MapViewBuilder setWorld(@NotNull @NotNull org.bukkit.World world)
      Sets the world the map is associated with.
      Parameters:
      world - the world
      Returns:
      this MapViewBuilder instance for chaining
    • setScale

      public MapViewBuilder setScale(@NotNull org.bukkit.map.MapView.Scale scale)
      Sets the scale of the map.
      Parameters:
      scale - the map's scale
      Returns:
      this MapViewBuilder instance for chaining
    • setLocked

      public MapViewBuilder setLocked(boolean locked)
      Sets whether the map is locked.
      Parameters:
      locked - true to lock the map, false to unlock
      Returns:
      this MapViewBuilder instance for chaining
    • setTrackingPosition

      public MapViewBuilder setTrackingPosition(boolean tracking)
      Sets whether the map should track player positions.
      Parameters:
      tracking - true to track player positions, false otherwise
      Returns:
      this MapViewBuilder instance for chaining
    • setUnlimitedTracking

      public MapViewBuilder setUnlimitedTracking(boolean unlimited)
      Sets whether the map has unlimited tracking.
      Parameters:
      unlimited - true to enable unlimited tracking, false otherwise
      Returns:
      this MapViewBuilder instance for chaining
    • addRenderer

      public MapViewBuilder addRenderer(@NotNull @NotNull org.bukkit.map.MapRenderer renderer)
      Adds a renderer to the map.
      Parameters:
      renderer - the MapRenderer to add
      Returns:
      this MapViewBuilder instance for chaining
    • removeRenderer

      public MapViewBuilder removeRenderer(@NotNull @NotNull org.bukkit.map.MapRenderer renderer)
      Removes a renderer from the map.
      Parameters:
      renderer - the MapRenderer to remove
      Returns:
      this MapViewBuilder instance for chaining
    • build

      public org.bukkit.map.MapView build()
      Gets the configured MapView.
      Returns:
      the configured map view