13
0

Fix SchematicCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-01-11 21:58:02 +01:00
Ursprung 604e683362
Commit 6f93130fe6

Datei anzeigen

@ -284,13 +284,12 @@ public class SchematicCommand extends SWCommand {
predicates.add(node -> node.getItem().equalsIgnoreCase(query[finalI + 1])); predicates.add(node -> node.getItem().equalsIgnoreCase(query[finalI + 1]));
break; break;
case "-owner": case "-owner":
try {
SteamwarUser steamwarUser = SteamwarUser.get(query[finalI + 1]); SteamwarUser steamwarUser = SteamwarUser.get(query[finalI + 1]);
predicates.add(node -> node.getOwner() == steamwarUser.getId()); if (steamwarUser == null) {
} catch (Exception e) {
player.sendMessage(SchematicSystem.PREFIX + "§cDer Spieler §e" + query[finalI + 1] + " §cexistiert nicht"); player.sendMessage(SchematicSystem.PREFIX + "§cDer Spieler §e" + query[finalI + 1] + " §cexistiert nicht");
return; return;
} }
predicates.add(node -> node.getOwner() == steamwarUser.getId());
} }
i++; i++;
} }
@ -660,7 +659,10 @@ public class SchematicCommand extends SWCommand {
@Override @Override
public List<String> tabCompletes(CommandSender commandSender, String[] strings, String s) { public List<String> tabCompletes(CommandSender commandSender, String[] strings, String s) {
if (strings.length == 0) { if (strings.length == 0) {
return Collections.singletonList(s); List<String> list = new ArrayList<>();
list.add(s);
list.addAll(searchMapper.keySet());
return list;
} }
String last = strings[strings.length - 1]; String last = strings[strings.length - 1];
if (searchMapper.containsKey(last)) { if (searchMapper.containsKey(last)) {