ForgeHax icon indicating copy to clipboard operation
ForgeHax copied to clipboard

How does xray add list

Open Jet-fuel opened this issue 4 years ago • 1 comments

command : xray blocks addlist iron_ore coal_ore gold_ore

BaseSimpleSettingCollection.java

 newSimpleCommand()
        .name("addlist")
        .description("Adds an element to the collection")
        .argument(argument)
        .executor(args -> {
          int size = this.size();
          for (int i = 0; i < size; i++) {
            IValue<E> arg = args.get(i);
            if (this.add(arg.getValue())) {
              args.inform("Added \"%s\" to the collection.", arg.getStringValue());
            } else {
              args.warn("Could not add \"%s\" to the collection (possible duplicate?).", arg.getStringValue());
            }
          }

        })
        .build();

Is there a way to add a list?

Jet-fuel avatar Jun 30 '21 16:06 Jet-fuel

I would need to add support for variable length arguments

fr1kin avatar Jun 30 '21 19:06 fr1kin