Interface OpenContext
- All Superinterfaces:
ViewContext
- All Known Implementing Classes:
OpenContextImpl
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 Summary
Modifier and TypeMethodDescriptionvoidAborts this open with zero side effects; the player's current view is untouched.booleanReturns whethercancelOpen()was called for this open.voidoverrideRows(int rows) Overrides the configured row count for this open only.voidoverrideTitle(@NotNull String title) Overrides the configured title for this open only.
-
Method Details
-
overrideTitle
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 whethercancelOpen()was called for this open.- Returns:
truewhen this open is cancelled
-