-
-
Notifications
You must be signed in to change notification settings - Fork 415
WXYZ property and handler reorganization #8274
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
base: dev/feature
Are you sure you want to change the base?
Conversation
Efnilite
left a comment
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.
will take a closer look later, looks good on first glance
src/main/java/org/skriptlang/skript/bukkit/base/types/LocationClassInfo.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/Property.java
Outdated
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/handlers/ContainsHandler.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/handlers/base/ConditionPropertyHandler.java
Show resolved
Hide resolved
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.
Since this is targeting dev/feature, shouldn't the usages of
if (!SkriptConfig.useTypeProperties.value())
be removed? As the 2.13 release message stated properties were fully coming out in 2.14
src/main/java/org/skriptlang/skript/lang/properties/handlers/ContainsHandler.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/handlers/TypedValueHandler.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/handlers/WXYZHandler.java
Show resolved
Hide resolved
src/main/java/org/skriptlang/skript/lang/properties/handlers/base/ConditionPropertyHandler.java
Show resolved
Hide resolved
...main/java/org/skriptlang/skript/lang/properties/handlers/base/ExpressionPropertyHandler.java
Show resolved
Hide resolved
I don't want to do that until we're sure properties is ready for full release, so it'll be a different pr |
Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com> Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
…XYZHandler.java Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Problem
Many things have coordinates. Vanilla Skript includes 3 currently, Location, Vector, and Quaternion, though Chunk should also be included. Unifying these under a single property removes the confusion of
x componentvsx coordinateand allows many more types to use thex ofsyntax.Solution
Adds a property for WXYZ components, where the handler is able to declare which axes it supports.
I've also tried to sneak in 40 other files worth of reorganization changes, moving Handlers out to their own classes to avoid another massive DefaultX-like class. These have no functional impact, and can mostly be ignored when reviewing.
I decided on a combined WXYZ property for boilerplate's sake. I had a separate property for each axis, which does lower complexity for each individual handler, but leads to a lot of duplicated code between each one for each class. Since most things in Skript will deal with at least 2 axis and normally 3 or more, I thought it simpler for the user to just combine the property into one. If anyone has good arguments against this, I'm all ears.
Testing Completed
All prior behavior is maintained via existing tests. Manual testing confirms interactions with things like player velocity.
Supporting Information
Breaking changes: removes
[vector|quaternion]from the component syntax (vector x of {var})Completes: none
Related: none