diff --git a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java index c15ee14..5322a14 100644 --- a/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java +++ b/SpigotCore_Main/src/de/steamwar/command/SWCommandUtils.java @@ -199,28 +199,6 @@ class SWCommandUtils { return arguments; } - @SuppressWarnings("unchecked") - private static Function mapper(Parameter parameter) { - Class clazz = parameter.getType(); - if (parameter.isVarArgs()) { - clazz = clazz.getComponentType(); - } - - if (clazz.isEnum()) { - Class> enumClass = (Class>) clazz; - return s -> ENUM_MAPPER.apply(enumClass, s); - } - - String name = clazz.getTypeName(); - SWCommand.Mapper mapper = parameter.getAnnotation(SWCommand.Mapper.class); - if (mapper != null) { - name = mapper.mapper(); - } - - TypeMapper typeMapper = MAPPER_FUNCTIONS.getOrDefault(name, ERROR_FUNCTION); - return typeMapper::map; - } - public static void addMapper(String name, TypeMapper mapper) { if (MAPPER_FUNCTIONS.containsKey(name)) return; MAPPER_FUNCTIONS.put(name, mapper);