Class MapPolygon

java.lang.Object
journeymap.api.v2.client.model.MapPolygon

public final class MapPolygon extends Object
A MapPolygon is a sequence of at least 3 BlockPos. The first point must be the LOWER-LEFT (or SouthEast) point in the sequence, and should be ordered counterclockwise. The last point will be connected to the first when rendered.

Note that the actual list passed into the constructor isn't retained; the points are copied into an unmodifiable list. If you need to update the points, pass in a new list entirely.

Setters use the Builder pattern so they can be chained.

  • Constructor Details

    • MapPolygon

      public MapPolygon(net.minecraft.core.BlockPos... points)
      Constructor.
      Parameters:
      points - See class description for details on ordering.
      Throws:
      IllegalArgumentException - if conditions for a proper polygon aren't met.
    • MapPolygon

      public MapPolygon(List<net.minecraft.core.BlockPos> points)
      Constructor.
      Parameters:
      points - See class description for details on ordering.
      Throws:
      IllegalArgumentException - if conditions for a proper polygon aren't met.
  • Method Details

    • getPoints

      public List<net.minecraft.core.BlockPos> getPoints()
      Gets an unmodifiable list of the points.
      Returns:
      points
    • setPoints

      public MapPolygon setPoints(List<net.minecraft.core.BlockPos> points)
    • iterator

      public Iterator<net.minecraft.core.BlockPos> iterator()
      Iterates the points.
      Returns:
      iterator
    • toString

      public String toString()
      Overrides:
      toString in class Object