#3848: Add support for showing dialogs in configuration state

Co-authored-by: Outfluencer <git@outfluencer.dev>
This commit is contained in:
FlorianMichael
2025-06-16 07:29:16 +10:00
committed by md_5
parent 3cd530f007
commit d5bcabdc60
3 changed files with 23 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ import net.md_5.bungee.protocol.packet.PlayerListHeaderFooter;
import net.md_5.bungee.protocol.packet.PluginMessage;
import net.md_5.bungee.protocol.packet.SetCompression;
import net.md_5.bungee.protocol.packet.ShowDialog;
import net.md_5.bungee.protocol.packet.ShowDialogDirect;
import net.md_5.bungee.protocol.packet.StoreCookie;
import net.md_5.bungee.protocol.packet.SystemChat;
import net.md_5.bungee.protocol.packet.Transfer;
@@ -851,6 +852,12 @@ public final class UserConnection implements ProxiedPlayer
{
Preconditions.checkState( getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_21_6, "Dialogs are only supported in 1.21.6 and above" );
if ( ch.getEncodeProtocol() == Protocol.CONFIGURATION )
{
unsafe.sendPacket( new ShowDialogDirect( dialog ) );
return;
}
unsafe.sendPacket( new ShowDialog( Either.right( dialog ) ) );
}
}