All Superinterfaces:
ViewContext
All Known Implementing Classes:
OpenContextImpl

@NonExtendable public interface OpenContext extends ViewContext
Context for View.onOpen: runs before any container exists.

Phase validity: inventory(), update() and updateTitle(String) throw IllegalStateException naming this phase. Cancelling aborts the open with zero side effects — the player's current view, if any, stays untouched and protected. close() is valid but redundant here — prefer cancelOpen(), which preserves the player's current view intact.

  • Method Details

    • overrideTitle

      void overrideTitle(@NotNull @NotNull String title)
      Overrides the configured title for this open only.
      Parameters:
      title - the per-open title, legacy color codes supported
    • overrideRows

      void overrideRows(int rows)
      Overrides the configured row count for this open only.
      Parameters:
      rows - the per-open row count, 1 to 6
    • cancelOpen

      void cancelOpen()
      Aborts this open with zero side effects; the player's current view is untouched.
    • isOpenCancelled

      boolean isOpenCancelled()
      Returns whether cancelOpen() was called for this open.
      Returns:
      true when this open is cancelled