fr1kin / ForgeHax

A Minecraft cheat that runs as a Forge mod
MIT License
483 stars 131 forks source link

How does xray add list #352

Open Jet-fuel opened 3 years ago

Jet-fuel commented 3 years ago

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?

fr1kin commented 3 years ago

I would need to add support for variable length arguments