Skript dev37c
paper 1.12.1
Reproduce:
command /test:
trigger:
loop command sender's permissions:
send loop-value
This code will send an error message claiming that command sender's permissions is a single value. However when using send command sender's permissions it will print a list that looks exactly like the contents of a list variable.
Also, in the internal docs the expression is referred to as a list.
Looks like isSingle() in https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/expressions/ExprPermissions.java is improperly implemented.
The ExprPermissions is improperly implemented @TheLimeGlass, PropertyExpressions are supposed to return exactly one (nullable) property per player - AKA if there is one player, then there should be exactly one permission. A way to fix this: make ExprPermissions a SingleExpression (accepting only one player in the syntax, this is confusing now since multiple players can have permissions that completely cancel out).
Does this solution sound okay?
Otherwise the ExprPermission should at least be made a PropertyExpression<Player, String[]> (the []), but disclaimer here, I have no idea if this is supported, and even if it is, in my opinion would be a worse solution
I didn't make this shit, I attempted to fix it and convert to a property. I was the one arguing that this should never have been added.
@TheLimeGlass it was you, since you converted it in a property expression but who cares about who did it.
@TheLimeGlass that's correct. Like you've just noticed, you made it a property expression. And this is what caused this particular issue - this expression for the reason above probably shouldn't be a property one, just a single one. I only mentioned you to let you know for the future 馃尩
@Nicofisi Yeah that solution seems ok. I wish Skript has some class that let you easily make property expressions that worked like how we want it to in this case with multiple objects for each thing the property is coming from.
You want me to fix someone's shit expression or remove it? Because all I want is to remove this syntax.
I made the suggestion in the original pull request thread, it was an example of a PropertyExpression for the guy who originally added this...
Go look at that thread.
And side note Skript should handle multiple entires both incoming and outgoing. The converter per each element is all that should be used. I haven't ever looked at this code since it got committed, so I can't tell if it's Skript or the expression.
@TheLimeGlass I don't know what you're going on about or how you misread it but your converting of this expression caused this bug, not anyone else's fault as the bug was not present before. Not that it mattered that you were the one that did it anyways, some relatively small changes can fix it.
edit: realtively -> relatively
I made the suggestion in the original pull request thread, it was an example of a PropertyExpression for the guy who originally added this...
Maybe you misread something, we're saying that this should not be a PropertyExpression.
Unless we are misinterpreting something - then please link us to that PR
Most helpful comment
@TheLimeGlass I don't know what you're going on about or how you misread it but your converting of this expression caused this bug, not anyone else's fault as the bug was not present before. Not that it mattered that you were the one that did it anyways, some relatively small changes can fix it.
edit: realtively -> relatively