-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Improve Location Comparison #6205
Merged
APickledWalrus
merged 5 commits into
SkriptLang:dev/patch
from
sovdeeth:location-comparison
Dec 1, 2023
Merged
Improve Location Comparison #6205
APickledWalrus
merged 5 commits into
SkriptLang:dev/patch
from
sovdeeth:location-comparison
Dec 1, 2023
Conversation
This file contains 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
sovdeeth
added
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
2.7
Targeting a 2.7.X version release
labels
Nov 26, 2023
Fusezion
suggested changes
Nov 26, 2023
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.
One minor suggestion, besides this looks alright.
Co-authored-by: Fusezion <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Fusezion
approved these changes
Nov 26, 2023
AyhamAl-Ali
approved these changes
Nov 26, 2023
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.
Noice ⚡
src/main/java/ch/njol/skript/classes/data/DefaultComparators.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Ayham Al Ali <[email protected]>
APickledWalrus
approved these changes
Dec 1, 2023
sovdeeth
added a commit
that referenced
this pull request
Dec 17, 2023
* Fix ExprRandomNumber using a method from Java 17 (#6022) * Fix changing remaining time of command cooldown (#6021) Update ScriptCommand.java Co-authored-by: Moderocky <[email protected]> * Bump version to 2.7.1 (#5993) Co-authored-by: Moderocky <[email protected]> * fix 3 stray INSERT VERSIONs from 2.7.0 (#6027) correct incorrect values * Fix Documentation Actions on dev/patch (#6042) * Tidy up parts of config class. (#6025) * Add Release Model Document (#6041) Add release model document Co-authored-by: Ayham Al Ali <[email protected]> Co-authored-by: Moderocky <[email protected]> * (Cherry Pick) Fix cast throwing if existing variable for command storage exists (#5942) (#6026) Fix cast throwing if existing variable for command storage exists (#5942) * Fix cast throwing if existing variable for command storage exists * Update src/main/java/ch/njol/skript/command/ScriptCommand.java --------- Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Ayham Al Ali <[email protected]> * (Cherry Pick) Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978) (#6023) Fix NPE with invalid attributes and clean up ExprEntityAttribute (#5978) * Avoid NPE and clean up class * Update ExprEntityAttribute.java * Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java * Update src/main/java/ch/njol/skript/expressions/ExprEntityAttribute.java --------- Co-authored-by: sovdee <[email protected]> Co-authored-by: Ayham Al Ali <[email protected]> * Fix multiple aliases sections not working (#6050) * Fix error when unloading a script with multiple variables sections (#6047) * Returns the old 2.6.4 duplicate variables section behaviour. * Add an error but i don't know what it's for * Add lots of brackets to keep walrus happy :}}} * Add load tracker to prevent multiple loading. * Prevent variable data wipe, fix another bug * Support IDEs from the dark ages that don't know what a star is and think it orbits the earth or something * add a test --------- Co-authored-by: APickledWalrus <[email protected]> * Bump actions/checkout from 3 to 4 (#6029) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... * ⚒ Disable Javadocs generation for nightly docs & improvements (#6059) * Let's see if I am good at GH actions 🤞 * ops! * Use proper docs template reference when possible * Disable nightly javadocs generation with an option Each javadoc is ~50mb, which was causing the big size of the docs! while each docs generation is ~2mb only * Fix building * Revert pull changes They are not what fixed the issue, probably the old PRs aren't syncing for some reason * Update build.gradle --------- Co-authored-by: Moderocky <[email protected]> * Change the target branch of dependabot (#6063) Update dependabot.yml * ⚒ Fix stop all sounds NPE (#6067) * Bump actions/checkout from 3 to 4 (#6069) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LimeGlass <[email protected]> * Bump org.gradle.toolchains.foojay-resolver-convention from 0.5.0 to 0.7.0 (#6070) Bump org.gradle.toolchains.foojay-resolver-convention Bumps org.gradle.toolchains.foojay-resolver-convention from 0.5.0 to 0.7.0. --- updated-dependencies: - dependency-name: org.gradle.toolchains.foojay-resolver-convention dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LimeGlass <[email protected]> * Bump org.easymock:easymock from 5.1.0 to 5.2.0 (#6071) Bumps [org.easymock:easymock](https://github.com/easymock/easymock) from 5.1.0 to 5.2.0. - [Release notes](https://github.com/easymock/easymock/releases) - [Changelog](https://github.com/easymock/easymock/blob/master/ReleaseNotes.md) - [Commits](easymock/easymock@easymock-5.1.0...easymock-5.2.0) --- updated-dependencies: - dependency-name: org.easymock:easymock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LimeGlass <[email protected]> * Bump io.papermc.paper:paper-api from 1.20.1-R0.1-SNAPSHOT to 1.20.2-R0.1-SNAPSHOT (#6072) * Bump io.papermc.paper:paper-api Bumps io.papermc.paper:paper-api from 1.20.1-R0.1-SNAPSHOT to 1.20.2-R0.1-SNAPSHOT. --- updated-dependencies: - dependency-name: io.papermc.paper:paper-api dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Apply 1.20.2 to the test runner * Deprecate org.bukkit.util.Consumer usage in EntityData * Adapt against the Java Consumer instead of Bukkit's * Resolve existing method deprecation * Adapt against the Java Consumer instead of Bukkit's * Update developer note * Result in reflection for Bukkit Consumer * Resolve ThrownPotion Consumer * Result in reflection for Bukkit Consumer * Pretty else if * Add common reflective spawn method. * Use common spawn method in potion class. * Remove old suppression! * Whoops I forgot about the consumer * Don't need reflection import anymore :) * Thrown potion class --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: LimeGlass <[email protected]> Co-authored-by: TheLimeGlass <[email protected]> Co-authored-by: Moderocky <[email protected]> * Pull request template defaults (#5665) Update pull_request_template.md * Fix EvtPlayerChunkEnter Comparison & Cleanup (#5965) Initial (cherry picked from commit 389c002) Co-authored-by: Moderocky <[email protected]> * Fixes EffSecSpawn not properly handling local variables created within the section (#6033) Communicate local variables between consumer calls thanks pickle Co-authored-by: Moderocky <[email protected]> * Remove PlayerPreprocessCommandEvent listener and clean up Commands (#5966) * Remove PPCE listener and clean up Commands * Apply suggestions from code review Co-authored-by: LimeGlass <[email protected]> * Update Commands.java * we hate breaking changes --------- Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Moderocky <[email protected]> * Clean up vector classes and fix a few bugs. * More improvements * Apply suggestions from code review Co-authored-by: Ayham Al Ali <[email protected]> * Budget Expansion * Fix Logging Issues In ExpressionEntryData (#6081) Fix duplicate logging * Prepare For Release 2.7.1 (#6082) * Update Minecraft wiki links to new domain (#6078) * ⚒ Fix fake player count paper check error (#6090) * Fix Command Help (#6080) Fix issues and cleanup CommandHelp class Co-authored-by: Moderocky <[email protected]> * Bump net.kyori:adventure-text-serializer-bungeecord from 4.3.0 to 4.3.1 (#6084) Bumps [net.kyori:adventure-text-serializer-bungeecord](https://github.com/KyoriPowered/adventure-platform) from 4.3.0 to 4.3.1. - [Release notes](https://github.com/KyoriPowered/adventure-platform/releases) - [Commits](KyoriPowered/adventure-platform@v4.3.0...v4.3.1) --- updated-dependencies: - dependency-name: net.kyori:adventure-text-serializer-bungeecord dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ayham Al Ali <[email protected]> * Fix unloading/reloading a directory in the scripts effect (#6106) * Moved unloading to a common method. * Accidental double space 😬 * Force UTF-8 encoding for Gradle daemon (#6103) Co-authored-by: Moderocky <[email protected]> * Corrected Javadocs name, title (#6038) * Javadoc Title,Name * Update .gitignore Co-authored-by: LimeGlass <[email protected]> --------- Co-authored-by: Ayham Al Ali <[email protected]> Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Moderocky <[email protected]> * Rebase JUnit references fix for dev/patch (#6057) * Fix options issue in functions (#6121) * Fix command permission messages (2.7.1 issue) (#6126) re-add permission handling during PPCE to get around spigot behavior. * Fix stack overflow when stringifying block inventories. (#6117) * Fix stack overflow when stringifying block inventories. * Blanket catch until a better solution is found. * Fix comparison of cyclical types (specifically comparing times) (#6128) * Add cyclical type helper. * Make time cyclical. * Add special comparison for cyclical types. * Add some tests. * Fix floating point rounding error in loop N times (#6132) Fix floating point error in loop X times. * Fix Sorted List Expression (#6102) * Fix ExprSortedList * Update src/main/java/ch/njol/skript/expressions/ExprSortedList.java Co-authored-by: LimeGlass <[email protected]> * Fix test Co-authored-by: Moderocky <[email protected]> --------- Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Moderocky <[email protected]> * Fix colour codes being reset in reload message. (#6150) Fix colour codes being reset. * Fix ExprDurability's Changer (#6154) * Fix ExprDurability's changer * Change method name. * Add simple test. --------- Co-authored-by: Moderocky <[email protected]> * Catch the exception when pushing entity by non finite vector (#5765) * Fix issues with ExprDrops (#6130) * refactor ExprDrops, fix bugs, add test fixed setting drops to multiple items/experience values at once fixed null values being left in drops after removing items maintained behavior but behavior needs a big update * small cleanup * Fix JUnit test location * import shenanigans --------- Co-authored-by: Moderocky <[email protected]> * Prepare For Release (2.7.2) (#6166) * Prevent InventoryHolder -> X chaining (#6171) * Prevent InventoryHolder -> X chaining * Improve Location Comparison (#6205) * Allow asynchronous SkriptEvent#check execution (#6201) * Fix ExprSets conflicting (#6123) * Prepare for Release (2.7.3) (#6208) * Further corrections * Fix NPE issue with drops in 1.20.2 * Update StructFunction.java --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: _tud <[email protected]> Co-authored-by: sovdee <[email protected]> Co-authored-by: Moderocky <[email protected]> Co-authored-by: LimeGlass <[email protected]> Co-authored-by: Ayham Al Ali <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: TheLimeGlass <[email protected]> Co-authored-by: DelayedGaming <[email protected]> Co-authored-by: Spongecade <[email protected]> Co-authored-by: MihirKohli <[email protected]> Co-authored-by: _tud <[email protected]> Co-authored-by: 3meraldK <[email protected]>
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
Recently, @Fusezion and Orestaz on the SkUnity discord discovered that it was quite difficult to compare the location of a wall-mounted button to a set of created locations due to how Skript displays yaw.
Since Minecraft and Bukkit store yaws from -180 to 180, a yaw of -90 in a Location is actually output as 270 through ExprYawPitch.
This causes a new location created with that yaw to not match the original location.
This is because Bukkit compares the exact bits of the location fields in Location#equals(). It also means that a location with a pitch of 0 is not equal to the exact same location with a pitch of -0.0. This is great for checking if they're exactly equal, but for our purposes I believe we should be less strict.
This PR adds a Location - Location comparator that uses the toVector method and the Vector#equals() method to compare xyz without floating point issues, checks the worlds for equality, and normalizes the yaw and pitch before checking those for equality.
This should be consistent with how the locations are actually expressed ingame and should cut down on issues with location comparison.
Target Minecraft Versions: any
Requirements: none
Related Issues: none