Interface IServerAPI

All Superinterfaces:
CommonAPI

public interface IServerAPI extends CommonAPI
Server-side JourneyMap API for reading and manipulating waypoints.
  • Method Details

    • getWaypoints

      List<Waypoint> getWaypoints(net.minecraft.server.level.ServerPlayer player)
      Gets all waypoints stored for the given server player.
      Parameters:
      player - the server player
      Returns:
      the player's waypoints
    • getWaypoints

      List<Waypoint> getWaypoints(UUID playerUUID)
      Gets all waypoints stored for the player with the given UUID.
      Parameters:
      playerUUID - the player UUID
      Returns:
      the player's waypoints
    • getWaypoints

      List<Waypoint> getWaypoints()
      Gets all waypoints stored on the server for all players and all global waypoints.
      Returns:
      all waypoints
    • getWaypoint

      Waypoint getWaypoint(UUID playerUUID, String guid)
      Gets the waypoint with the given GUID for the specified player.
      Parameters:
      playerUUID - the player UUID
      guid - the waypoint GUID
      Returns:
      the waypoint, or null if not found
    • getAllGroups

      List<WaypointGroup> getAllGroups(UUID playerUUID)
      Gets all waypoint groups for the specified player.
      Parameters:
      playerUUID - the player UUID
      Returns:
      the player's waypoint groups
    • getGroup

      WaypointGroup getGroup(UUID playerUUID, String guid)
      Gets the waypoint group with the given GUID for the specified player.
      Parameters:
      playerUUID - the player UUID
      guid - the group GUID
      Returns:
      the group, or null if not found
    • addPlayerWaypoint

      void addPlayerWaypoint(UUID playerUUID, Waypoint waypoint)
      Adds or updates a waypoint for the specified player. Fires WaypointEvent (CREATE or UPDATE, cancellable).
      Parameters:
      playerUUID - the player UUID
      waypoint - the waypoint to add or update
    • deletePlayerWaypoint

      void deletePlayerWaypoint(UUID playerUUID, String guid)
      Deletes the waypoint with the given GUID for the specified player. Fires WaypointEvent (DELETED).
      Parameters:
      playerUUID - the player UUID
      guid - the waypoint GUID to delete
    • addPlayerGroup

      void addPlayerGroup(UUID playerUUID, WaypointGroup group)
      Adds or updates a waypoint group for the specified player.
      Parameters:
      playerUUID - the player UUID
      group - the group to add or update
    • deletePlayerGroup

      void deletePlayerGroup(UUID playerUUID, String guid, boolean deleteWaypoints)
      Deletes the waypoint group with the given GUID for the specified player.
      Parameters:
      playerUUID - the player UUID
      guid - the group GUID to delete
      deleteWaypoints - if true, also deletes all waypoints belonging to the group
    • getGlobalWaypoints

      List<Waypoint> getGlobalWaypoints()
      Gets all waypoints that are not tied to specific players. These waypoints are visible to every player when they log in.
      Returns:
      all global waypoints
    • getGlobalWaypoint

      Waypoint getGlobalWaypoint(String guid)
      Gets the global waypoint with the given GUID.
      Parameters:
      guid - the waypoint GUID
      Returns:
      the waypoint, or null if not found
    • getAllGlobalGroups

      List<WaypointGroup> getAllGlobalGroups()
      Gets all global waypoint groups.
      Returns:
      all global waypoint groups
    • getGlobalGroup

      WaypointGroup getGlobalGroup(String guid)
      Gets the global waypoint group with the given GUID.
      Parameters:
      guid - the group GUID
      Returns:
      the group, or null if not found
    • addGlobalWaypoint

      void addGlobalWaypoint(Waypoint waypoint)
      Adds or updates a global waypoint. Fires GlobalWaypointEvent (CREATE or UPDATE, cancellable).
      Parameters:
      waypoint - the waypoint to add or update
    • deleteGlobalWaypoint

      void deleteGlobalWaypoint(String guid)
      Deletes the global waypoint with the given GUID. Fires GlobalWaypointEvent (DELETED).
      Parameters:
      guid - the waypoint GUID to delete
    • addGlobalGroup

      void addGlobalGroup(WaypointGroup group)
      Adds or updates a global waypoint group. Fires GlobalWaypointGroupEvent (CREATE or UPDATE, cancellable).
      Parameters:
      group - the group to add or update
    • deleteGlobalGroup

      void deleteGlobalGroup(String guid, boolean deleteWaypoints)
      Deletes the global waypoint group with the given GUID. Fires GlobalWaypointGroupEvent (DELETED).
      Parameters:
      guid - the group GUID to delete
      deleteWaypoints - if true, also deletes all waypoints belonging to the group
    • shareWaypoint

      void shareWaypoint(Waypoint waypoint, UUID fromUUID, String fromName, List<UUID> targetIds, boolean allKnownUsers)
      Programmatically share a waypoint with one or more players. Fires ServerEventRegistry.WAYPOINT_SHARE_SUBMIT_EVENT (cancellable) before storing pending entries.
      Parameters:
      waypoint - the waypoint to share
      fromUUID - UUID of the player or system initiating the share
      fromName - display name shown to recipients
      targetIds - specific recipients; ignored if allKnownUsers is true
      allKnownUsers - if true, shares with all players in PlayerData
    • getOverlayApi

      IServerOverlayAPI getOverlayApi()
      Returns the server-side overlay API, used to push polygon overlays to connected players' JourneyMap clients.
      Returns:
      the overlay API