From 39f25462ff40513eb138234cd85c244f910eb645 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 30 May 2022 13:10:02 +0200 Subject: [PATCH] Fix SchematicCommand --- .../schematicsystem/commands/SchematicCommand.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index c3acd21..06c7c4e 100644 --- a/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Core/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -19,6 +19,7 @@ package de.steamwar.schematicsystem.commands; +import de.steamwar.command.AbstractTypeMapper; import de.steamwar.command.SWCommand; import de.steamwar.command.SWCommandUtils; import de.steamwar.command.TypeMapper; @@ -49,7 +50,7 @@ import static de.steamwar.schematicsystem.commands.SchematicCommandUtils.*; public class SchematicCommand extends SWCommand { - private static final Map> searchMapper = new HashMap<>(); + private static final Map> searchMapper = new HashMap<>(); static { searchMapper.put("-type", SWCommandUtils.createMapper(SchematicType.values().stream().map(SchematicType::name).toArray(String[]::new))); @@ -657,8 +658,8 @@ public class SchematicCommand extends SWCommand { public TypeMapper publicDirNodeTypeMapper() { return new TypeMapper() { @Override - public List tabCompletes(CommandSender commandSender, String[] strings, String s) { - List list = publicCommandTypeMapper.tabCompletes(commandSender, strings, s); + public Collection tabCompletes(CommandSender commandSender, String[] strings, String s) { + Collection list = publicCommandTypeMapper.tabCompletes(commandSender, strings, s); list.removeIf(s1 -> !s1.endsWith("/")); return list; } @@ -731,7 +732,7 @@ public class SchematicCommand extends SWCommand { } @Override - public List tabCompletes(CommandSender commandSender, String[] strings, String s) { + public Collection tabCompletes(CommandSender commandSender, String[] strings, String s) { if (strings.length == 0) { List list = new ArrayList<>(); list.add(s); @@ -740,7 +741,7 @@ public class SchematicCommand extends SWCommand { } String last = strings[strings.length - 1]; if (searchMapper.containsKey(last)) { - TypeMapper mapper = searchMapper.get(last); + AbstractTypeMapper mapper = searchMapper.get(last); if (mapper == null) { List list = new ArrayList<>(searchMapper.keySet()); list.add(s);