Skip to content
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 the contains condition #2439

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

Blueyescat
Copy link
Contributor

@Blueyescat Blueyescat commented Sep 6, 2019

Description

This PR reworks CondContains to make it more stable:

  • Cleaned up its code
    • Removed much unnecessary codes
  • Fixed some issues
  • Added more features
  • After the last changes, it wasn't supporting lists like contains 1 and 2 or contains 1 or 2, this is fixed

Here are some codes (effect commands) i used to test:
https://gist.github.com/Blueyescat/eadf558783dd7aa57d7255a069e7d449
all of them works as expected

Current syntaxes:

%inventories% (has|have) %itemtypes% [in [(the[ir]|his|her|its)] inventory]
%inventories% (doesn't|does not|do not|don't) have %itemtypes% [in [(the[ir]|his|her|its)] inventory]
%inventories/strings/objects% contain[s] %itemtypes/strings/objects%
%inventories/strings/objects% (doesn't|does not|do not|don't) contain %itemtypes/strings/objects%
[the] list [of] %objects% (doesn't|does not|do not|don't) contain %objects%
[the] list [of] %objects% contain[s] %objects%
(all|1¦any|2¦none) of %strings% contain[s] %strings%

Target Minecraft Versions: any
Requirements: none
Related Issues: #1404, #1838 and #2122

@FranKusmiruk FranKusmiruk added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Sep 17, 2019
@FranKusmiruk
Copy link
Member

Since we're still in beta-phase, I am going to merge this though I believe it may need some changes before the actual release comes out, watch out for any issues.

That being said, thanks for the contribution!

@FranKusmiruk FranKusmiruk merged commit bab1c0f into SkriptLang:master Sep 27, 2019
@Blueyescat Blueyescat deleted the rework-condcontains branch September 28, 2019 11:42
@TheLimeGlass TheLimeGlass mentioned this pull request Jul 3, 2020
@TPGamesNL TPGamesNL mentioned this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants