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 Type
    Method
    Description
    void
    clearAll(net.minecraft.server.level.ServerPlayer player, String modId)
    Remove every overlay this addon has shown to the player.
    void
    remove(net.minecraft.server.level.ServerPlayer player, String modId, String overlayId)
    Remove a single overlay (by modId + overlayId) from a player's client.
    void
    show(net.minecraft.server.level.ServerPlayer player, String modId, ServerPolygon... polygons)
    Push polygon overlays to a single player.
  • Method Details

    • show

      void show(net.minecraft.server.level.ServerPlayer player, String modId, ServerPolygon... polygons)
      Push polygon overlays to a single player. Each ServerPolygon's overlayId is stable and addon-chosen; re-calling show() 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 ServerPlayer is a no-op.

      Parameters:
      player - the recipient
      modId - the addon's mod id (becomes the JourneyMap displayable owner)
      polygons - one or more ServerPolygons
    • remove

      void remove(net.minecraft.server.level.ServerPlayer player, String modId, String overlayId)
      Remove a single overlay (by modId + 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 recipient
      modId - the addon's mod id
      overlayId - the addon-stable id used in a prior show()
    • clearAll

      void clearAll(net.minecraft.server.level.ServerPlayer player, String modId)
      Remove every overlay this addon has shown to the player.
      Parameters:
      player - the recipient
      modId - the addon's mod id