Class DialogTicket
java.lang.Object
com.ultikits.ultitools.ui.dialog.DialogTicket
Invalidatable lifetime boundary for server-retained button callbacks.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<DialogTicket.Callbacks> private final Loggerprivate final Stringprivate final AtomicBooleanprivate final UUID -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)<R>DialogTicket(UiSession<R> session, UiBackend.BackendCallbacks<R> callbacks, DialogAnswers answers, Logger logger, String ownerName) Retains the typed callbacks only until the first answer or invalidation. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ButtonRole role, @Nullable io.papermc.paper.dialog.DialogResponseView response, net.kyori.adventure.audience.Audience audience) Accepts an action from Paper without running module code directly.(package private) voidEnds a game-interrupted screen without sending a later clear-dialog packet to a different screen.(package private) booleanDrops all references to the intent and callbacks, returning whether a screen still needs dismissal.private static <R> voidreport(UiIntent<R> intent, UiBackend.BackendCallbacks<R> callbacks, DialogAnswers answers, ButtonRole role, @Nullable io.papermc.paper.dialog.DialogResponseView response, String ownerName) Forwards only the value type validated against this same intent.(package private) voidshown()Marks the screen visible only after the presenter returns successfully on the entity lane.
-
Field Details
-
viewerId
-
ownerName
-
logger
-
showing
-
handler
-
-
Constructor Details
-
DialogTicket
<R> DialogTicket(UiSession<R> session, UiBackend.BackendCallbacks<R> callbacks, DialogAnswers answers, Logger logger, String ownerName) Retains the typed callbacks only until the first answer or invalidation.- Type Parameters:
R- the intent's answer type
-
-
Method Details
-
report
private static <R> void report(UiIntent<R> intent, UiBackend.BackendCallbacks<R> callbacks, DialogAnswers answers, ButtonRole role, @Nullable @Nullable io.papermc.paper.dialog.DialogResponseView response, String ownerName) Forwards only the value type validated against this same intent.- Type Parameters:
R- the intent's answer type
-
shown
void shown()Marks the screen visible only after the presenter returns successfully on the entity lane. -
accept
public void accept(ButtonRole role, @Nullable @Nullable io.papermc.paper.dialog.DialogResponseView response, net.kyori.adventure.audience.Audience audience) Accepts an action from Paper without running module code directly. Paper dispatches clicks on the server main thread, which also runs entity-lane close operations. This serialization prevents invalidation between consuming the handler and clearing showing below; the two atomic operations alone do not make that transition safe for concurrent callback dispatch. -
interrupt
void interrupt()Ends a game-interrupted screen without sending a later clear-dialog packet to a different screen. -
invalidate
boolean invalidate()Drops all references to the intent and callbacks, returning whether a screen still needs dismissal.
-