java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.engine.phase.OpenPhase

@Internal public final class OpenPhase extends Object
First half of the open pipeline (spec ยง7.2-7.6): session and store creation, initial-state binding, onOpen with cancellation, previous-session replacement, per-open config merge, layout resolution and container creation. Constructed and invoked only by ViewEngine.
  • Constructor Details

    • OpenPhase

      public OpenPhase(@NotNull @NotNull ViewEngine engine, @NotNull @NotNull SessionRegistry sessions, @NotNull @NotNull SlotPainter painter)
      Creates the phase.
      Parameters:
      engine - the owning engine, used to close a replaced previous session
      sessions - the per-player session registry
      painter - the slot painter, used to apply placeholders to the container title
  • Method Details

    • openSession

      @Nullable public @Nullable ViewSession openSession(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull RegisteredView registered, @NotNull @NotNull ViewArguments arguments)
      Opens a session up to (and including) container creation; first render and registration happen in FirstRenderPhase.
      Parameters:
      player - the viewer
      registered - the registration of the view to open
      arguments - the open arguments
      Returns:
      the new session ready for first render, or null when the open was cancelled (by cancelOpen() or a throwing onOpen) with zero side effects
      Throws:
      IllegalArgumentException - when an initialState argument is present with a mismatching type (propagates before any side effect)
      ViewConfigurationException - when a per-open override recorded in onOpen is invalid (propagates before the previous session is replaced)