[Feat] AsyncOfflinePlayerArgument#633
Conversation
willkroboth
left a comment
There was a problem hiding this comment.
Haven't personally tested functionality, but code looks good and makes sense to me.
I think it's fine to not include any automated tests in this PR given that OfflinePlayerArgument doesn't have any tests yet. I'm not sure how MockBukkit handles offline players, so that's something that could just be figured out later.
|
The reason I didn't include a separate unit test for this is that the |
|
Yeah, that doesn't test the actual OfflinePlayerArgument, that tests the custom implementation we have for the test toolkit to make it NMS independent. |
Whoops, I see! Thanks for the heads up :-) |
[Feat] AsyncOfflinePlayerArgument Documentation CommandAPI/CommandAPI#633
Description
This pull request introduces the
AsyncOfflinePlayerArgument, which extends theSafeOverrideableArgumentclass. The new class wraps the existingOfflinePlayerArgumentwithin aCompletableFuture<OfflinePlayer>, enabling asynchronous handling of the offline player argument in commands. By using this approach, the logic involving API calls to fetch the offline player will be executed off the main thread, reducing the risk of blocking the server's main thread and improving performance.PR Checklist
Documentation
See CommandAPI/docs#1
This PR is in continuation of #632, which I accidentally closed :-)