Package journeymap.api.v2.server.overlay
Record Class ServerPolygon
java.lang.Object
java.lang.Record
journeymap.api.v2.server.overlay.ServerPolygon
- Record Components:
overlayId- the addon-stable handle for this overlaydimension- the dimension this overlay belongs topolygons- one or more polygons, all sharing the same shape propsprops- style and visibility for every polygon in this overlay
public record ServerPolygon(String overlayId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, List<OverlayPolygon> polygons, OverlayShapeProps props)
extends Record
One logical overlay pushed by a server addon. May contain many disjoint
OverlayPolygons sharing one set of OverlayShapeProps.
The overlayId is a stable, addon-chosen string. Re-calling
IServerOverlayAPI.show(net.minecraft.server.level.ServerPlayer, java.lang.String, journeymap.api.v2.server.overlay.ServerPolygon...) with the same (modId, overlayId) pair
replaces any prior version on the client; calling
IServerOverlayAPI.remove(net.minecraft.server.level.ServerPlayer, java.lang.String, java.lang.String) removes it.
-
Constructor Summary
ConstructorsConstructorDescriptionServerPolygon(String overlayId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, List<OverlayPolygon> polygons, OverlayShapeProps props) Creates an instance of aServerPolygonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> Returns the value of thedimensionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoverlayIdrecord component.polygons()Returns the value of thepolygonsrecord component.props()Returns the value of thepropsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ServerPolygon
public ServerPolygon(String overlayId, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, List<OverlayPolygon> polygons, OverlayShapeProps props) Creates an instance of aServerPolygonrecord class.
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
overlayId
Returns the value of theoverlayIdrecord component.- Returns:
- the value of the
overlayIdrecord component
-
dimension
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension()Returns the value of thedimensionrecord component.- Returns:
- the value of the
dimensionrecord component
-
polygons
Returns the value of thepolygonsrecord component.- Returns:
- the value of the
polygonsrecord component
-
props
Returns the value of thepropsrecord component.- Returns:
- the value of the
propsrecord component
-