-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
String -> UUID #7497
base: dev/feature
Are you sure you want to change the base?
String -> UUID #7497
Conversation
# Conflicts: # src/main/java/ch/njol/skript/util/Utils.java
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.
Looks good, I've wanted this for a long time.
Just a few small concerns.
src/main/java/ch/njol/skript/expressions/ExprEntityFromUUID.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprEntityFromUUID.java
Outdated
Show resolved
Hide resolved
Can you elaborate exactly how this improves things? you mentioned "performs better", is there testing to back this up? I see there's a |
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.
This is going to break existing code, since a string cannot be compared to a UUID without the user knowing and parsing as a UUID.
Adding a String to UUID converter is a bad idea though, as the parser throws lots of random inputs through the parsing of ClassInfos and converters. It's always been best to avoid String to anything convert.
So for this reason, it's probably a breaking change. This current implementation is good to avoid this issue.
src/main/java/ch/njol/skript/expressions/ExprEntityFromUUID.java
Outdated
Show resolved
Hide resolved
I have done tests and they appear to show that this method is faster. The |
Tests were failing because of a silly problem from me. This PR will not have breaking changes |
Instead of a String to UUID converter, I have added a UUID and String comparator which solves this issue. |
I meant, like, numbers showing the performance benefits, I'd still like to see those. |
Here are the tests, https://discord.com/channels/135877399391764480/836220422223036467/1331680812546134097 |
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.
Looks good, nothing major.
Description
Let the Strings become UUIDs!
This PR aims to convert the current implementation of UUIDs (strings) to actual UUIDs. This may help some addons (like SkBee with UUID tags) and it performs better. This PR has also cleaned up UUIDs in general. I.e. it no longer uses regex (or try-catches), there is now a method in the Utils class which returns whether a string has the valid pattern for a UUID.
With this PR, UUIDs will look some what like this:
There are some PRs that could use this. For example, #7069.
Target Minecraft Versions: any
Requirements: none
Related Issues: none