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() {
878878 */
879879 default void showDialog (final @ NotNull DialogLike dialog ) {
880880 }
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+ }
881893}
Original file line number Diff line number Diff line change @@ -227,6 +227,11 @@ default void showDialog(final @NotNull DialogLike dialog) {
227227 for (final Audience audience : this .audiences ()) audience .showDialog (dialog );
228228 }
229229
230+ @ Override
231+ default void closeDialog () {
232+ for (final Audience audience : this .audiences ()) audience .closeDialog ();
233+ }
234+
230235 /**
231236 * An audience that forwards everything to a single other audience.
232237 *
@@ -414,5 +419,10 @@ default void clearResourcePacks() {
414419 default void showDialog (final @ NotNull DialogLike dialog ) {
415420 this .audience ().showDialog (dialog );
416421 }
422+
423+ @ Override
424+ default void closeDialog () {
425+ this .audience ().closeDialog ();
426+ }
417427 }
418428}
You can’t perform that action at this time.
0 commit comments