MCPcopy Create free account
hub / github.com/ZetaMap/MoreCommands / Search

Method Search

src/main/java/util/Search.java:13–39  ·  view source on GitHub ↗
(String[] str, TempData pDefault)

Source from the content-addressed store, hash-verified

11 public boolean error = false;
12
13 public Search(String[] str, TempData pDefault) {
14 Players result = Players.findByName(str);
15
16 if (result.found) {
17 this.player = result.data;
18 this.rest = result.rest;
19
20 } else {
21 if (result.rest.length == 0) return;
22 else if (result.rest[0].contains(",")) {
23 String co[] = result.rest[0].split(",");
24
25 if (co.length == 2 && Strings.canParseInt(co[0]) && Strings.canParseInt(co[1])) {
26 Seq<String> rest = Seq.with(result.rest);
27 rest.remove(0);
28
29 this.player = pDefault;
30 this.XY = new int[] {Strings.parseInt(co[0]), Strings.parseInt(co[1])};
31 this.rest = rest.toArray(String.class);
32 return;
33
34 } else Players.err(pDefault.player, "Wrong coordinates!");
35 } else Players.errNotOnline(pDefault.player);
36
37 this.error = true;
38 }
39 }
40}

Callers

nothing calls this directly

Calls 5

findByNameMethod · 0.95
errMethod · 0.95
errNotOnlineMethod · 0.95
containsMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected