SteamWar/SpigotCore
Archiviert
13
0

Hotfix SubCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2021-12-08 17:45:01 +01:00
Ursprung 0e993d8f3e
Commit acb23705d8

Datei anzeigen

@ -45,7 +45,7 @@ class SubCommand {
GuardChecker guardChecker;
Class<?> varArgType = null;
private boolean help;
boolean noTabComplete = false;
boolean noTabComplete;
SubCommand(SWCommand swCommand, Method method, String[] subCommand, Map<String, TypeMapper<?>> localTypeMapper, Map<String, GuardChecker> localGuardChecker, boolean help, String[] description, boolean noTabComplete) {
this.swCommand = swCommand;
@ -71,7 +71,8 @@ class SubCommand {
}
SWCommand.Mapper mapper = parameter.getAnnotation(SWCommand.Mapper.class);
if (clazz.isEnum() && mapper == null && !MAPPER_FUNCTIONS.containsKey(clazz.getTypeName()) && !localTypeMapper.containsKey(clazz.getTypeName())) {
SWCommand.ClassMapper classMapper = parameter.getAnnotation(SWCommand.ClassMapper.class);
if (clazz.isEnum() && mapper == null && classMapper == null && !MAPPER_FUNCTIONS.containsKey(clazz.getTypeName()) && !localTypeMapper.containsKey(clazz.getTypeName())) {
Class<Enum<?>> enumClass = (Class<Enum<?>>) clazz;
List<String> tabCompletes = new ArrayList<>();
for (Enum<?> enumConstant : enumClass.getEnumConstants()) {
@ -82,7 +83,9 @@ class SubCommand {
}
String name = clazz.getTypeName();
if (mapper != null) {
if (classMapper != null) {
name = classMapper.value().getTypeName();
} else if (mapper != null) {
name = mapper.value();
} else {
SWCommand.StaticValue staticValue = parameter.getAnnotation(SWCommand.StaticValue.class);