Class RendererSession

java.lang.Object
ke.ric.renderer.api.RendererSession
All Implemented Interfaces:
AutoCloseable

public final class RendererSession extends Object implements AutoCloseable
Optional plugin-owned capture/render lifecycle. Construct, request, discover clients and close on the server thread. Cancellation of a returned future is safe from any thread. There are no retries, gameplay cooldowns or persistence; low-level multi-pass workflows can use client(). This helper is supplied with the development API preview and should be tested with its matching development provider; its presence does not establish support in an older production installation.
  • Constructor Details

    • RendererSession

      public RendererSession(org.bukkit.plugin.Plugin owner)
      Registers lifecycle listeners for this enabled owner on the server thread; close during owner disable.
  • Method Details

    • client

      public RendererClient client()
      Discovers/reacquires the current service's client; service absence is a typed failure.
    • captureAndRender

      public CompletableFuture<RenderResult> captureAndRender(CaptureRequest request)
      Captures and renders under one wall-clock deadline from the request's settings. Successful results are published on the server thread after a final lifecycle check. Synchronous provider and scheduling failures settle the returned future too; cancellation releases owned work.
    • captureAndRender

      public CompletableFuture<RenderResult> captureAndRender(CaptureRequest request, double fovDegrees)
      Captures with an explicit field of view in degrees under the same lifecycle and deadline.
    • captureAndRender

      public CompletableFuture<RenderResult> captureAndRender(CaptureRequest request, List<SceneEntity> entities)
      Captures, appends complete exact entities, then renders under the same deadline and lifecycle. The entity list is copied before capture; empty lists also work with older providers.
    • captureAndRender

      public CompletableFuture<RenderResult> captureAndRender(CaptureRequest request, double fovDegrees, List<SceneEntity> entities)
      Captures a custom field of view, appends exact entities and renders with one deadline.
    • mainThreadExecutor

      public Executor mainThreadExecutor()
      Explicit Bukkit dispatcher, usable from any thread. Scheduling rejection is propagated to the caller, not swallowed. Accepted commands are not revoked by provider replacement; callers must check their destination's liveness. Bukkit provides no callback guarantee after disable.
    • close

      public void close()
      Settles all owned work, closes the client and detaches listeners/timers. Idempotent.
      Specified by:
      close in interface AutoCloseable