-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Add experience point support to ExprTotalExperience #7581
Add experience point support to ExprTotalExperience #7581
Conversation
assert experience of {_xp} is 0 with "clearing xp of Experience doesn't work" | ||
set {_xp} to 5 xp | ||
reset experience of {_xp} | ||
assert experience of {_xp} is 0 with "resetting xp of Experience doesn't work" |
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.
assert experience of {_xp} is 0 with "resetting xp of Experience doesn't work" | |
assert experience of {_xp} is 0 with "resetting xp of Experience doesn't work" | |
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.
Won't let me highlight these, but
public void change(Event event, Object @Nullable [] delta, ChangeMode mode) {
and add an empty line after the #getPropertyName
@@ -25,44 +25,43 @@ | |||
"", | |||
"if player's total experience is greater than 100:", | |||
"\tset player's total experience to 0", |
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.
"\tset player's total experience to 0", | |
"\tset player's total experience to 0", |
@@ -25,44 +25,43 @@ | |||
"", | |||
"if player's total experience is greater than 100:", | |||
"\tset player's total experience to 0", | |||
"\tgive player 1 diamond" | |||
"\tgive player 1 diamond", |
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.
"\tgive player 1 diamond", | |
"\tgive player 1 diamond", |
"\tset {_xp} to event-experience", | ||
"\tbroadcast experience of {_xp}" |
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.
"\tset {_xp} to event-experience", | |
"\tbroadcast experience of {_xp}" | |
"\tset {_xp} to event-experience", | |
"\tbroadcast experience of {_xp}" |
default: | ||
return null; | ||
} | ||
public @Nullable Class<?>[] acceptChange(ChangeMode mode) { |
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.
public @Nullable Class<?>[] acceptChange(ChangeMode mode) { | |
public Class<?> @Nullable [] acceptChange(ChangeMode mode) { |
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.
Does an experience->number converter cause any issues? Seems like it'd be a nicer solution.
closing in favor of #7602 |
Description
This PR adds 'experience point' support to the total experience expression, cleans up the Experience and the syntax class and adds some tests.
I made this PR for the "on level progress change:" event. It did not let you get how much experience was changed as a number.
Target Minecraft Versions: any
Requirements: none
Related Issues: none