1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Add methods to open quick actions and pause screen additions dialog tags and add command to open quick actions dialog tag

This commit is contained in:
Eclipse
2025-06-06 14:24:26 +00:00
parent 946c1615ea
commit 05f1bf2135
5 changed files with 112 additions and 17 deletions

View File

@@ -75,6 +75,33 @@ public interface GeyserConnection extends Connection, CommandSource {
*/
int protocolVersion();
/**
* Tries to open the {@code minecraft:pause_screen_additions} dialog tag. This method opens this tag the same way Java does, that is:
*
* <ul>
* <li>If there are multiple dialogs in the additions tag, the {@code minecraft:custom_options} dialog is opened to select a dialog.</li>
* <li>If there is one dialog in the additions tag, that dialog is opened.</li>
* <li>If there are no dialogs in the tag, but there are server links sent to the client, the {@code minecraft:server_links} dialog is opened.</li>
* <li>If all of the above fails, no dialog is opened.</li>
* </ul>
*
* <p>This method returns {@code true} if a dialog was opened, and {@code false} otherwise.</p>
*/
boolean openPauseScreenAdditions();
/**
* Tries to open the {@code minecraft:quick_actions} dialog tag. This method opens this tag the same way Java does, that is:
*
* <ul>
* <li>If there are multiple dialogs in the actions tag, the {@code minecraft:quick_actions} dialog is opened to select a dialog.</li>
* <li>If there is one dialog in the actions tag, that dialog is opened.</li>
* <li>If there are no dialogs in the tag, no dialog is opened.</li>
* </ul>
*
* <p>This method returns {@code true} if a dialog was opened, and {@code false} otherwise.</p>
*/
boolean openQuickActions();
/**
* @param javaId the Java entity ID to look up.
* @return a {@link GeyserEntity} if present in this connection's entity tracker.