Fix ShowModeParameterType and TraceCommand for TabComplete
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
2c77e1a0d1
Commit
851de9575e
@ -46,6 +46,9 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Linked(LinkageType.COMMAND)
|
||||
public class TraceCommand extends SWCommand {
|
||||
@ -83,16 +86,19 @@ public class TraceCommand extends SWCommand {
|
||||
showModeParameterTypeSet.add(showModeParameterTypesMap.get(previousArgument));
|
||||
}
|
||||
showModeParameterTypeSet.remove(null);
|
||||
|
||||
Set<ShowModeParameterType> removed = showModeParameterTypeSet.stream()
|
||||
.map(ShowModeParameterType::getRemoved)
|
||||
.map(Supplier::get)
|
||||
.flatMap(Arrays::stream)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<String> tabCompletes = new ArrayList<>();
|
||||
for (Map.Entry<ShowModeParameterType, List<String>> entry : showModeParameterTypeListMap.entrySet()) {
|
||||
if ((showModeParameterTypeSet.contains(ShowModeParameterType.INTERPOLATE_XZ) || showModeParameterTypeSet.contains(ShowModeParameterType.INTERPOLATE_Y)) && entry.getKey() == ShowModeParameterType.ADVANCED) {
|
||||
continue;
|
||||
}
|
||||
if (showModeParameterTypeSet.contains(entry.getKey())) {
|
||||
if (removed.contains(entry.getKey()) || showModeParameterTypeSet.contains(entry.getKey())) {
|
||||
continue;
|
||||
}
|
||||
tabCompletes.addAll(entry.getValue());
|
||||
showModeParameterTypeSet.addAll(Arrays.asList(entry.getKey().getRemoved().get()));
|
||||
}
|
||||
return tabCompletes;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public enum ShowModeParameterType {
|
||||
ADVANCED(showModeParameter -> {
|
||||
showModeParameter.setInterpolate_Y(true);
|
||||
showModeParameter.setInterpolate_XZ(true);
|
||||
}, Arrays.asList("-advanced", "-a"), "INTERPOLATE_Y", "INTERPOLATE_XZ"),
|
||||
}, Arrays.asList("-advanced", "-a", "advanced"), "INTERPOLATE_Y", "INTERPOLATE_XZ"),
|
||||
EXPLODE(showModeParameter -> showModeParameter.setExplodeOnly(true), Arrays.asList("-explode", "-explodeonly")),
|
||||
TICKS(showModeParameter -> showModeParameter.setTicks(true), Arrays.asList("-ticks", "-t"));
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren