MCPcopy Create free account
hub / github.com/boxbeam/RedLib / getArgType

Method getArgType

src/redempt/redlib/dev/ChainCommand.java:44–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 }
43
44 public ArgType<String> getArgType() {
45 return new ArgType<>("commandchain", s -> s).setTab((c, s) -> {
46 int i = s.length - 1;
47 while (i > 0 && !s[i].endsWith(";")) {
48 i--;
49 }
50 if (i + 1 < s.length && s[i].endsWith(";")) {
51 i++;
52 }
53 if (s.length - i == 0 || s.length - i == 1) {
54 return new ArrayList<>(knownCommands.keySet());
55 }
56 Command cmd = knownCommands.get(s[i]);
57 if (cmd != null) {
58 return cmd.tabComplete(c, s[i], Arrays.copyOfRange(s, i + 1, s.length));
59 }
60 return new ArrayList<>();
61 });
62 }
63
64}

Callers 1

onEnableMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected