Interface ITelegraphHandler


  • public interface ITelegraphHandler
    Handler for creating and managing telegraphs. Access via API.getTelegraphs()

    Example usage:

     // Create a telegraph
     var telegraph = API.getTelegraphs().createCircle(5.0);
     telegraph.setDuration(60); // 3 seconds
     telegraph.setColor(0x80FF0000); // Semi-transparent red
    
     // Spawn it
     var instance = telegraph.spawn(world, x, y, z);
    
     // Or save as a preset for reuse
     API.getTelegraphs().save("myCircle", telegraph);
    
     // Load preset later
     var loaded = API.getTelegraphs().get("myCircle");
     loaded.spawn(world, x, y, z);
     
    • Method Detail

      • createCircle

        ITelegraph createCircle​(float radius)
        Create a circle telegraph.
        Parameters:
        radius - The radius of the circle
        Returns:
        A new telegraph configuration
      • createRing

        ITelegraph createRing​(float outerRadius,
                              float innerRadius)
        Create a ring telegraph.
        Parameters:
        outerRadius - The outer radius
        innerRadius - The inner radius
        Returns:
        A new telegraph configuration
      • createLine

        ITelegraph createLine​(float length,
                              float width)
        Create a line telegraph.
        Parameters:
        length - The length of the line
        width - The width of the line
        Returns:
        A new telegraph configuration
      • createCone

        ITelegraph createCone​(float length,
                              float angle)
        Create a cone telegraph.
        Parameters:
        length - The length of the cone
        angle - The angle of the cone in degrees
        Returns:
        A new telegraph configuration
      • createSquare

        ITelegraph createSquare​(float radius)
        Create a square telegraph. The square is axis-aligned by default and can be rotated with yaw when spawned.
        Parameters:
        radius - The half-size of the square (distance from center to edge)
        Returns:
        A new telegraph configuration
      • createPoint

        ITelegraph createPoint()
        Create a point telegraph.
        Returns:
        A new telegraph configuration
      • create

        ITelegraph create​(String type)
        Create a telegraph by type name.
        Parameters:
        type - Type name: "circle", "ring", "line", "cone", "square", "point" (case insensitive)
        Returns:
        A new telegraph configuration, or null if type is invalid
      • spawn

        ITelegraphInstance spawn​(ITelegraph telegraph,
                                 IWorld world,
                                 double x,
                                 double y,
                                 double z)
        Spawn a telegraph at a position.
        Parameters:
        telegraph - The telegraph configuration
        world - The world
        x - X position
        y - Y position
        z - Z position
        Returns:
        The spawned instance
      • spawn

        ITelegraphInstance spawn​(ITelegraph telegraph,
                                 IWorld world,
                                 double x,
                                 double y,
                                 double z,
                                 float yaw)
        Spawn a telegraph at a position with rotation.
        Parameters:
        telegraph - The telegraph configuration
        world - The world
        x - X position
        y - Y position
        z - Z position
        yaw - Rotation yaw
        Returns:
        The spawned instance
      • spawn

        ITelegraphInstance spawn​(ITelegraph telegraph,
                                 IEntity entity)
        Spawn a telegraph following an entity.
        Parameters:
        telegraph - The telegraph configuration
        entity - The entity to follow
        Returns:
        The spawned instance
      • spawn

        ITelegraphInstance spawn​(ITelegraph telegraph,
                                 IEntity entity,
                                 float yaw)
        Spawn a telegraph following an entity with rotation.
        Parameters:
        telegraph - The telegraph configuration
        entity - The entity to follow
        yaw - Rotation yaw
        Returns:
        The spawned instance
      • get

        ITelegraph get​(String name)
        Get a saved telegraph preset by name.
        Parameters:
        name - The preset name
        Returns:
        The telegraph configuration, or null if not found
      • save

        void save​(String name,
                  ITelegraph telegraph)
        Save a telegraph as a preset.
        Parameters:
        name - The name for the preset
        telegraph - The telegraph configuration to save
      • delete

        void delete​(String name)
        Delete a saved preset.
        Parameters:
        name - The preset name
      • has

        boolean has​(String name)
        Check if a preset exists.
        Parameters:
        name - The preset name
        Returns:
        True if the preset exists
      • getSavedNames

        String[] getSavedNames()
        Get all saved preset names.
        Returns:
        Array of preset names
      • remove

        void remove​(String instanceId)
        Remove an active telegraph by instance ID.
        Parameters:
        instanceId - The instance ID to remove
      • remove

        void remove​(ITelegraphInstance instance)
        Remove an active telegraph instance.
        Parameters:
        instance - The instance to remove