Package journeymap.api.v2.server.overlay
Interface IServerOverlayAPI
public interface IServerOverlayAPI
Server-side API for pushing polygon overlays to a single player's
JourneyMap client. The consumer addon is responsible for all state: when
to push, who to push to, and any persistence. JourneyMap does not store
server-pushed overlays.
Reach this from a server plugin via:
IServerOverlayAPI overlayApi = jmServerApi.getOverlayApi();
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemove every overlay this addon has shown to the player.voidRemove a single overlay (bymodId+overlayId) from a player's client.voidshow(net.minecraft.server.level.ServerPlayer player, String modId, ServerPolygon... polygons) Push polygon overlays to a single player.
-
Method Details
-
show
Push polygon overlays to a single player. EachServerPolygon'soverlayIdis stable and addon-chosen; re-callingshow()with the same(modId, overlayId)replaces the prior version on the client.Calling with no polygons is a no-op. Calling for an offline or disconnected
ServerPlayeris a no-op.- Parameters:
player- the recipientmodId- the addon's mod id (becomes the JourneyMap displayable owner)polygons- one or moreServerPolygons
-
remove
Remove a single overlay (bymodId+overlayId) from a player's client. Calling for an offline player is a no-op; removing an overlay that does not exist on the client is a silent no-op.- Parameters:
player- the recipientmodId- the addon's mod idoverlayId- the addon-stable id used in a priorshow()
-
clearAll
Remove every overlay this addon has shown to the player.- Parameters:
player- the recipientmodId- the addon's mod id
-