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

Add support for character codepoints #6334

Merged
merged 9 commits into from
May 8, 2024
Merged

Conversation

UnderscoreTud
Copy link
Member

Description

This PR adds two expressions allowing you to get the codepoint of a character and get a character at a codepoint


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@UnderscoreTud UnderscoreTud added the feature Pull request adding a new feature. label Jan 15, 2024
@sovdeeth
Copy link
Member

Can we get tests for this? Have you tested with negative numbers, infinities, NaN, etc?

@sovdeeth sovdeeth changed the base branch from master to dev/feature March 29, 2024 19:51
Comment on lines +55 to +57
public String convert(Integer integer) {
return String.valueOf((char) integer.intValue());
}
Copy link
Member

Choose a reason for hiding this comment

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

Do you think it's worth clamping values instead of allowing negative values to wrap around? I think it's fine either way but -1 = 65535 might be a bit confusing for users.

@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Apr 7, 2024
@sovdeeth sovdeeth removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label May 8, 2024
UnderscoreTud and others added 3 commits May 8, 2024 20:39
@UnderscoreTud UnderscoreTud requested a review from sovdeeth May 8, 2024 17:42
@Moderocky Moderocky merged commit 125f14b into dev/feature May 8, 2024
6 checks passed
@Moderocky Moderocky deleted the feature/codepoints branch May 8, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants