From f6197978243d82cc078ba3a33b726f2b2dfc3f56 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 30 May 2022 14:32:38 +0200 Subject: [PATCH] Fix enum mapper --- src/de/steamwar/command/SWCommandUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/command/SWCommandUtils.java b/src/de/steamwar/command/SWCommandUtils.java index e038e23..73468fa 100644 --- a/src/de/steamwar/command/SWCommandUtils.java +++ b/src/de/steamwar/command/SWCommandUtils.java @@ -218,12 +218,12 @@ public class SWCommandUtils { public static >, K> T createEnumMapper(Class> enumClass) { Map> enumMap = new HashMap<>(); for (Enum e : enumClass.getEnumConstants()) { - enumMap.put(e.name(), e); + enumMap.put(e.name().toLowerCase(), e); } return (T) new AbstractTypeMapper>() { @Override public Enum map(Object commandSender, String[] previousArguments, String s) { - return enumMap.get(s); + return enumMap.get(s.toLowerCase()); } @Override