CondContains is ... crazy.
Alyanos22 opened this issue · 13 comments
Skript/Server Version
.
Bug Description
// if "test" contain "hihi" | true | true
// if "test" contains "hihi" | true | true
// if "test", "test1" contain "hihi" | false | true
// if "test", "test1" contains "hihi" | false | false
Expected Behavior
Why is the variable "explicitSingle" true for ("if "test", "test1" contain "hihi"") - is that really wanted?
Steps to Reproduce
reproduce in IntelliJ :)
Errors or Screenshots
No response
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Code: explicitSingle = matchedPattern == 2 && parseResult.mark != 1 || containers.isSingle();
Pattern: %inventories/strings/objects% contain[(1¦s)] %itemtypes/strings/objects%
I just noticed that and wondered if its really explained when to use contain and when containS.
Because it seems to change something.
I just wonder for what the variable "explicitSingle" is, when it can be changed by adding an "s"...
"abc", "bcd", "cde" contain "c" -> true
: checks if each of the strings contain another string
"abc", "bcd", "cde" contains "c" -> false
: checks if the list of string contains a specific string
Closing as not a bug report or suggestion
Sorry, but how can I just use java's "contains"?
E.g.
List<String> list
list.contains("test")
How can I check if ONE or more of the list contains "c"? not all
This should really be done on the skunity discord, not here.
But you'd use if "x", "y" or "z" contain "a"