Skip to content
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

Apply new line (%nr%) in item lore correctly #3636

Merged
merged 7 commits into from
Jan 11, 2021

Conversation

yukukotani
Copy link
Contributor

@yukukotani yukukotani commented Dec 13, 2020

Description

Apply new line (%nr%) in item lore. It seems that #2505 forgot this.

e.g.
1 of stone with lore "first line%nl%second line"

The test case describes the behavior well.


Target Minecraft Versions: any
Requirements: none
Related Issues: #3544.

@yukukotani yukukotani changed the title Apply new line (%nr%) correctly in item lore Apply new line (%nr%) in item lore correctly Dec 13, 2020
@@ -62,10 +64,13 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean kleenean

@Override
protected ItemType[] get(Event e, ItemType[] source) {
String[] lore = this.lore.getArray(e);
List<String> lore = Arrays.stream(this.lore.getArray(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stream looks nice, but you should be able to replace the Arrays#stream call with this.lore.stream(e)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I didn't know about such a nice method!

Pikachu920
Pikachu920 previously approved these changes Dec 15, 2020
ShaneBeee
ShaneBeee previously approved these changes Dec 15, 2020
@ShaneBeee ShaneBeee changed the base branch from master to dev-2.5 December 15, 2020 21:14
@ShaneBeee ShaneBeee dismissed stale reviews from Pikachu920 and themself December 15, 2020 21:14

The base branch was changed.

@ShaneBeee ShaneBeee added 2.5 bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. labels Dec 15, 2020
@ShaneBeee ShaneBeee merged commit 0841a4f into SkriptLang:dev-2.5 Jan 11, 2021
@yukukotani yukukotani deleted the feature/new-line-in-lore branch January 12, 2021 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants