-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expose certain scoreboard related argument types #12541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I'll poke some other team members about this, so I'd wait a bit with implementing my feedback given how drastic it is.
paper-api/src/main/java/io/papermc/paper/InternalAPIBridge.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/InternalAPIBridge.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/InternalAPIBridge.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/command/brigadier/argument/ArgumentTypes.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/command/brigadier/argument/ArgumentTypes.java
Outdated
Show resolved
Hide resolved
* @throws IllegalArgumentException if entity is null | ||
* @see #getScores(ScoreHolder) | ||
*/ | ||
@NotNull Set<Score> getScoresFor(@NotNull ScoreHolder holder) throws IllegalArgumentException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are just copies from the ones above?
What is the point of these?
paper-server/src/main/java/io/papermc/paper/command/brigadier/ApiMirrorRootNode.java
Outdated
Show resolved
Hide resolved
paper-api/src/main/java/io/papermc/paper/command/brigadier/argument/operation/Operation.java
Outdated
Show resolved
Hide resolved
...erver/src/main/java/io/papermc/paper/command/brigadier/argument/operation/OperationImpl.java
Show resolved
Hide resolved
paper-server/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreHolder.java
Outdated
Show resolved
Hide resolved
0b2ca4b
to
4e0ae70
Compare
48706b4
to
c675e17
Compare
5e0e732
to
5dbc0bf
Compare
Rebased to 1.21.6 |
9afa696
to
732f946
Compare
732f946
to
375a424
Compare
Rebased to 1.21.7 |
Closes #12540
This PR exposes a few scoreboard related Vanilla arguments for use in-API.
OperationArgument
ScoreHolderArgument
ObjectiveArgument
whilst this argument is just a wrapper around a String, since it provides potentially useful errors, I decided to expose it anywaysTeamArgument
same as theObjectiveArgument
Operation Argument
(Brigadier jumpscare!) Operation argument usage preview
Code:
ScoreHolder Argument
In addition to adding the argument, I have also taken the liberty of exposing a
ScoreHolder
interface, which is implemented by all entities,OfflinePlayer
, and also has a string-only implementation.(Brigadier jumpscare!) ScoreHolder argument usage preview
Preview:Code:
Objective argument
(Brigadier jumpscare!) Objective argument usage preview
Objective argument (writable)
Vanilla differentiates between writable and non-writable objectives when resolving. Therefore, there is a second set of methods exposed on the
ObjectiveResolver
, which do this additional 'writable criteria' check.(Brigadier jumpscare!) Objective argument usage with writable resolvers
Team argument
This argument has a custom resolver attached to it in order to allow resolving not only for the main server scoreboard, but also any additional scoreboard. This is not a feature of the nms ScoreboardArgument, but I thought this might be a good thing to add for plugin reasons.
(Brigadier jumpscare!) Team argument usage preview