Package journeymap.api.v2.client.display
Class PolygonOverlay
java.lang.Object
journeymap.api.v2.client.display.Displayable
journeymap.api.v2.client.display.Overlay
journeymap.api.v2.client.display.PolygonOverlay
- All Implemented Interfaces:
Comparable<Displayable>
A polygon overlay displays a geometric area on a map. For example: An area of claimed chunks.
Setters use the Builder pattern so they can be chained.
Note that like all Displayables, simply changing this object doesn't guarantee the player will get the changes.
You must call IClientAPI.show(Displayable) in order for the changes to take effect
in JourneyMap.
-
Field Summary
Fields inherited from class journeymap.api.v2.client.display.Overlay
activeMapTypes, activeUIs, dimension, displayOrder, label, maxZoom, minZoom, needsRerender, overlayGroupName, overlayListener, textProperties, titleFields inherited from class journeymap.api.v2.client.display.Displayable
displayType, id, modId -
Constructor Summary
ConstructorsConstructorDescriptionPolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygon outerArea) Constructor.PolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygon outerArea, List<MapPolygon> holes) Constructor.PolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygonWithHoles polygon) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetHoles()(optional) A list of polygons treated as holes inside the outerAreaA polygon of the outer area to be displayed.Gets the shape properties used to display the polygons.setHoles(List<MapPolygon> holes) Sets a list of polygons treated as holes inside the outerAreasetOuterArea(MapPolygon outerArea) Sets the polygon of the outer area to be displayed.setPolygonWithHoles(MapPolygonWithHoles polygon) Sets the outer area and holes in one go.setShapeProperties(ShapeProperties shapeProperties) Sets the shape properties used to display the polygons.toString()Methods inherited from class journeymap.api.v2.client.display.Overlay
clearFlagForRerender, flagForRerender, getActiveMapTypes, getActiveUIs, getDimension, getDisplayOrder, getLabel, getMaxZoom, getMinZoom, getNeedsRerender, getOverlayGroupName, getOverlayListener, getTextProperties, getTitle, isActiveIn, isInZoomRange, setActiveMapTypes, setActiveUIs, setDimension, setDisplayOrder, setLabel, setMaxZoom, setMinZoom, setOverlayGroupName, setOverlayListener, setTextProperties, setTitle, toStringHelperMethods inherited from class journeymap.api.v2.client.display.Displayable
clampOpacity, clampRGB, compareTo, equals, getDisplayType, getGuid, getId, getModId, hashCode
-
Constructor Details
-
PolygonOverlay
public PolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygon outerArea) Constructor.- Parameters:
modId- Your mod id.outerArea- A polygon of the outer area to be displayed.
-
PolygonOverlay
public PolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygonWithHoles polygon) Constructor.- Parameters:
modId- Your mod id.polygon- A polygon of the outer area with holes to be displayed.
-
PolygonOverlay
public PolygonOverlay(String modId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, ShapeProperties shapeProperties, MapPolygon outerArea, @Nullable List<MapPolygon> holes) Constructor.- Parameters:
modId- Your mod id.outerArea- A polygon of the outer area to be displayed.holes- (Optional) A list of polygons treated as holes inside the outerArea
-
-
Method Details
-
getOuterArea
A polygon of the outer area to be displayed.- Returns:
- the outer area
-
setOuterArea
Sets the polygon of the outer area to be displayed.- Parameters:
outerArea- polygon- Returns:
- this
-
getHoles
(optional) A list of polygons treated as holes inside the outerArea- Returns:
- null if none specified
-
setHoles
Sets a list of polygons treated as holes inside the outerArea- Parameters:
holes- polygons- Returns:
- this
-
setPolygonWithHoles
Sets the outer area and holes in one go. -
getShapeProperties
Gets the shape properties used to display the polygons.- Returns:
- properties
-
setShapeProperties
Sets the shape properties used to display the polygons.- Parameters:
shapeProperties- properties- Returns:
- this
-
toString
-