Skip to content

Conversation

novitpw
Copy link
Contributor

@novitpw novitpw commented Sep 24, 2025

This PR improves the documentation for the dialog API example, as several issues were noticed after reading it. The PR includes the following fixes:

  • Using UUID instead of PlayerCommonConnection
  • Using ConcurrentHashMap, since events are triggered in different threads
  • One-minute timeout to prevent the player connection from hanging indefinitely
  • Manually closing the dialog using Audience#closeDialog, as the client sometimes doesn't do this if no button was pressed (e.g., in case of a timeout)
  • All of this includes a bit of adherence to best practices ;)

Copy link

github-actions bot commented Sep 24, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
papermc-docs ✅ Ready (View Log) Visit Preview acd3ff3

Copy link
Member

@olijeffers0n olijeffers0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link

@MrPowerGamerBR MrPowerGamerBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only nitpack that I have is that it would be nice to show how you can also clean up the map using the PlayerConnectionCloseEvent event too.

@Strokkur424 Strokkur424 merged commit 48f324f into PaperMC:main Oct 4, 2025
3 checks passed
@Strokkur424
Copy link
Member

Thank you for the pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants