Add experience point support to ExprTotalExperience#7581
Closed
erenkarakal wants to merge 2 commits into
Closed
Conversation
Efnilite
reviewed
Feb 5, 2025
| 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" No newline at end of file |
Member
There was a problem hiding this comment.
Suggested change
| 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" | |
Efnilite
approved these changes
Feb 5, 2025
Absolutionism
requested changes
Feb 5, 2025
Contributor
Absolutionism
left a comment
There was a problem hiding this comment.
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", | |||
Contributor
There was a problem hiding this comment.
Suggested change
| "\tset player's total experience to 0", | |
| "\tset player's total experience to 0", |
| "if player's total experience is greater than 100:", | ||
| "\tset player's total experience to 0", | ||
| "\tgive player 1 diamond" | ||
| "\tgive player 1 diamond", |
Contributor
There was a problem hiding this comment.
Suggested change
| "\tgive player 1 diamond", | |
| "\tgive player 1 diamond", |
Comment on lines
+31
to
+32
| "\tset {_xp} to event-experience", | ||
| "\tbroadcast experience of {_xp}" |
Contributor
There was a problem hiding this comment.
Suggested change
| "\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) { |
Contributor
There was a problem hiding this comment.
Suggested change
| public @Nullable Class<?>[] acceptChange(ChangeMode mode) { | |
| public Class<?> @Nullable [] acceptChange(ChangeMode mode) { |
sovdeeth
reviewed
Feb 6, 2025
Member
Author
|
closing in favor of #7602 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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