Class OpenPhase
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.engine.phase.OpenPhase
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 Summary
ConstructorsConstructorDescriptionOpenPhase(@NotNull ViewEngine engine, @NotNull SessionRegistry sessions, @NotNull SlotPainter painter) Creates the phase. -
Method Summary
Modifier and TypeMethodDescription@Nullable ViewSessionopenSession(@NotNull org.bukkit.entity.Player player, @NotNull RegisteredView registered, @NotNull ViewArguments arguments) Opens a session up to (and including) container creation; first render and registration happen inFirstRenderPhase.
-
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 sessionsessions- the per-player session registrypainter- 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 inFirstRenderPhase.- Parameters:
player- the viewerregistered- the registration of the view to openarguments- the open arguments- Returns:
- the new session ready for first render, or
nullwhen the open was cancelled (bycancelOpen()or a throwingonOpen) with zero side effects - Throws:
IllegalArgumentException- when aninitialStateargument is present with a mismatching type (propagates before any side effect)ViewConfigurationException- when a per-open override recorded inonOpenis invalid (propagates before the previous session is replaced)
-