File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
api/src/main/java/net/kyori/adventure/audience Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -878,4 +878,16 @@ default void clearResourcePacks() {
878
878
*/
879
879
default void showDialog (final @ NotNull DialogLike dialog ) {
880
880
}
881
+
882
+ /**
883
+ * Closes the dialog that is currently being shown to this audience, if any.
884
+ *
885
+ * <p>This will return the user to the previous dialog if one was opened from the
886
+ * current dialog.</p>
887
+ *
888
+ * @since 4.24.0
889
+ * @sinceMinecraft 1.21.6
890
+ */
891
+ default void closeDialog () {
892
+ }
881
893
}
Original file line number Diff line number Diff line change @@ -227,6 +227,11 @@ default void showDialog(final @NotNull DialogLike dialog) {
227
227
for (final Audience audience : this .audiences ()) audience .showDialog (dialog );
228
228
}
229
229
230
+ @ Override
231
+ default void closeDialog () {
232
+ for (final Audience audience : this .audiences ()) audience .closeDialog ();
233
+ }
234
+
230
235
/**
231
236
* An audience that forwards everything to a single other audience.
232
237
*
@@ -414,5 +419,10 @@ default void clearResourcePacks() {
414
419
default void showDialog (final @ NotNull DialogLike dialog ) {
415
420
this .audience ().showDialog (dialog );
416
421
}
422
+
423
+ @ Override
424
+ default void closeDialog () {
425
+ this .audience ().closeDialog ();
426
+ }
417
427
}
418
428
}
You can’t perform that action at this time.
0 commit comments