EngineHub / CommandHelper

Rapid scripting and command aliases for Minecraft owners
https://methodscript.com
Other
119 stars 71 forks source link

Let x_find accept 3 arguments, as intended. #1307

Closed Lildirt closed 2 years ago

Lildirt commented 2 years ago

tested using 3 args, seems to work fine.

Pieter12345 commented 2 years ago

While we are at it, is this documentation correct? array<string> {regex, [startFrom], [type] | regex, [startFrom], types} Looking at the code, I think that the actual type is array<string> {regex, [startFrom], [types] instead, where types is an array or a single type (read through ArgumentValidation.getEnumSet).

LadyCailin commented 2 years ago

Hmm, I think it's correct? We have 6 allowed permutations:

  1. regex
  2. regex, type
  3. regex, types
  4. regex, startFrom
  5. regex, startFrom, type
  6. regex, startFrom, types

Expanding out the signature permutations, we get:

  1. (sig 1) regex
  2. (sig 1) regex, startFrom
  3. (sig 1) regex, type
  4. (sig 1) regex, startFrom, type
  5. (sig 2) regex, types
  6. (sig 2) regex, startFrom, types

So looks like it lines up to me?

I'm going to go ahead and merge this, since this is definitely wrong, but if there's something I'm missing, we can always iterate more.