Skip to content

[Untested draft] Compatibility with offline players#2

Draft
Mark-225 wants to merge 1 commit into
TechnicJelle:mainfrom
Mark-225:main
Draft

[Untested draft] Compatibility with offline players#2
Mark-225 wants to merge 1 commit into
TechnicJelle:mainfrom
Mark-225:main

Conversation

@Mark-225

Copy link
Copy Markdown

Just a quick draft because I had nothing better to do for about 15 mins :D I didn't put too much effort into this so feel free to reject it if you had something else in mind for this feature.

  • Uses OfflinePlayer instead of Player, accepting all player names that have already played on the server
  • Uses Player::getDisplayName instead of OfflinePlayer::getName if the player happens to be online
  • Adds offline player names to tab completions and caches names for one minute (otherwise, each letter typed by the command sender would invoke IO calls on the player data directory and files)
  • Filters the names in tab completions to only contain the ones that start with whatever the user already typed (case-insensitive), making it easier to search through the potentially huge list of names

@TechnicJelle TechnicJelle marked this pull request as draft March 15, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant