Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Rework entity visibility

Open Efnilite opened this issue 1 year ago • 6 comments

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 with canSee. pls help :)


Target Minecraft Versions: 1.19+ (Skript 2.10) Requirements: none Related Issues: #6795

Efnilite avatar Jul 05 '24 11:07 Efnilite

Can this just be put into the already existing CanSee condition and PlayerVisibility effect instead of making brand new ones?

cheeezburga avatar Jul 05 '24 13:07 cheeezburga

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

Efnilite avatar Jul 05 '24 14:07 Efnilite

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.

cheeezburga avatar Jul 05 '24 15:07 cheeezburga

You can just change it entirely since 2.10 will be 1.19+

sovdeeth avatar Jul 05 '24 15:07 sovdeeth

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 :)

Efnilite avatar Jul 14 '24 11:07 Efnilite

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.

sovdeeth avatar Jul 18 '24 05:07 sovdeeth

@Efnilite conflicts :(

sovdeeth avatar Oct 13 '24 03:10 sovdeeth

@sovdeeth should be good now

Efnilite avatar Oct 13 '24 14:10 Efnilite