-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Rework entity visibility #6867
Rework entity visibility #6867
Conversation
Can this just be put into the already existing CanSee condition and PlayerVisibility effect instead of making brand new ones? |
Not sure about that, since the entity one has only been around since Spigot 1.19, but idk |
You should just be able to change which kind of type is accepted in the pattern based on whether or not a certain method exists, if that makes sense. |
You can just change it entirely since 2.10 will be 1.19+ |
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.
Just a few little things
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.
Just some small things I saw - I think some of them are just preference so up to you. Stuff like the star imports tho are pretty up there.
src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
Outdated
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.
re: mock tests, you would need to provide your own logic implementation for canSee, since mocked objects have no inherent logic. I'm not sure if a junit test here is worth it.
Shouldn't be in the scope of this PR.
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.
what's the status of the junit tests?
i think the EffEntityVisibility test is fine, but not really sure how to improve the one for CondCanSee. maybe adding an entity to a collection when it's hidden and then canSee checking that list? suggestions welcome :) |
That'd work! As long as there's some basic logic implementation. |
Co-authored-by: cheeezburga <47320303+cheeezburga@users.noreply.github.com>
Co-authored-by: Moderocky <admin@moderocky.com>
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.
Very good, very impressive.
src/test/java/org/skriptlang/skript/test/tests/syntaxes/conditions/CondCanSeeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/skriptlang/skript/test/tests/syntaxes/effects/EffEntityVisibilityTest.java
Outdated
Show resolved
Hide resolved
…s/EffEntityVisibilityTest.java Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com>
…ions/CondCanSeeTest.java Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com>
* Fix gradle temp * Start on displays * Save * More work * update gradle.build * stash * Progress so far * Finish bulk add * Finalize so far * Minimize adventure api * Fix static class check for not 1.19.4 * Fix missing display classinfo in pattern under 1.19.4 * Fix missing quaternions classinfo in pattern under 1.19.4 * Make sure test runs on only 1.19.4 * Address reviews and fix java 8 * Apply suggestions from code review Co-authored-by: sovdee <ethansovde@gmail.com> * Move classes * Apply changes * Move classes * Class rename * Update to Spigot's fix to TextAlignment * Return null when using w of vector * Update src/main/java/ch/njol/skript/expressions/ExprXYZComponent.java Co-authored-by: sovdee <ethansovde@gmail.com> * Use brackets * Add entity hiding * Add property init values for displays * 1.19.4 check * Add rotate syntaxes * Change example * Fix tests * shadow syntax missing * Change setting * Revert change * Update src/main/java/ch/njol/skript/conditions/CondCanSee.java * Fix imports from master merge * Get tests working * Add color reset * Update ExprXYZComponent.java * Update DisplayData.java * Update DisplayData.java * Change the package naming and merge item into its own class * Add versioning for hide effect * Add versioning for hide effect * Change tests * Update submodule skript-aliases * Fix tests * Fix tests * Fix tests * Apply suggestions from code review Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> * Apply changes * Add axis angle * Add axis angle * Update skript-aliases * fix merge error * Remove axisangle and only present quaternion to users * Add tests for basic quaternion features, cleanup and fix bugs with ExprXYZComponent, add tests Notable changes include changing float comparison behavior (needs discussion) and allowing multiple vectors/quaternions to be changed at once (will overwrite list indices, needs discussion) * Add ExprQuaternionAxisAngle and tests. Change float comparison to use dynamic epsilon value. * Temporary change to build.gradle for java 17 * Revert "Update src/main/java/ch/njol/skript/conditions/CondCanSee.java" This reverts commit 3da7b37. * Reverts entity hiding commits in favor of #6867 Shouldn't be in the scope of this PR. * version check for EQAA and displaydata cleanup * force 'rotation' in EQAA, fix classdef error, add itemtypes to block display entitydata pattern, add tests for display entitydata Not sure wh * Clean up colorOf, add tests, add alpha parameter to rgb function and color tostring, add rgba factory method + constructor Discussion needed surrounding type checking in colorof acceptChange * update Nullable annotations to jetbrains * Fix <1.19 errors (just for actions) and fix subtle issues with xyz component changer * rename package to bukkit * finish package refactor * Add tests for billboarding, rework display brightness and add tests, move joml utilities * tests + allow setting override to a single number * tests, cleanup, and bug fixes for glow override and hegiht/width * Interpolation and Shadow tests + correct reset value for shadow strength + guard against NaN and init * Tests and cleanup for teleportation duration, remove number from changers for tp duration and interpolation delay/duration * Transformation tests, cleanup, bugfixes. Removed unnecessary Joml utils class. * wrong version check for teleportation duration * Display view range tests, cleanup, finite guard, switch to Timespan#getAs * strip licenses * cleanup, tests for ItemDisplayTransfrom. Fixed default from being FIXED to NONE, changed lang for NONE to be no transform to avoid confusion * Remove ItemOfItemDisplay (redundant), cleanup/test the text display expressions. * small cleanup to textdisplayexprs and rename ItemFrameSlot to be more generic * rework ExprRotate * Completely rework rotation with new Rotator API. Add support for quaternions + displays in EffRotate * cleanup rotations - java 17 tests will fail until legacy tests are removed * Fix bugs with rotation, adds tests * Add drop shadow syntax and small cleanup of ExprTextOf * See through blocks syntax * Update ExprRotate.java * remove extra [a]'s * whoops! reverts a change to number accuracy config done for testing * Module-ize, package infos, remove mc version checks * rename display.expressions package, use for loops, move displaydata * display data improvements * requested changes 1 * update switches and remove banana * requested changes 2 * Apply suggestions from code review Co-authored-by: cheeezburga <47320303+cheeezburga@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: cheeezburga <47320303+cheeezburga@users.noreply.github.com> * fix expritemofentity description * Apply suggestions from code review Co-authored-by: cheeezburga <47320303+cheeezburga@users.noreply.github.com> * Update ExprDisplayHeightWidth.java * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * requested changes 2 + rotator docs * requested changes * Apply suggestions from code review Co-authored-by: Patrick Miller <apickledwalrus@gmail.com> * requested changes! --------- Co-authored-by: sovdee <ethansovde@gmail.com> Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com> Co-authored-by: Moderocky <admin@moderocky.com> Co-authored-by: cheeezburga <47320303+cheeezburga@users.noreply.github.com> Co-authored-by: Patrick Miller <apickledwalrus@gmail.com>
@Efnilite conflicts :( |
# Conflicts: # src/main/java/ch/njol/skript/conditions/CondCanSee.java # src/main/java/ch/njol/skript/effects/EffPlayerVisibility.java # src/main/java/ch/njol/skript/expressions/ExprHiddenPlayers.java
@sovdeeth should be good now |
Description
Adds support for the hideEntity, showEntity and canSee(Entity) and removes the player-only equivalents, which are functionally equivalent. Also updates the Hidden Players syntax to match the current style guide and to improve the naming of the variable required for
reveal hidden players of {_p}
.I wasn't sure on how to do the test for the
can see
condition, as this will have to be done with JUnit to mock the player, but I couldn't get it to work properly withcanSee
. pls help :)Target Minecraft Versions: 1.19+ (Skript 2.10)
Requirements: none
Related Issues: #6795