Skip to content

Commit 157fae5

Browse files
authored
fix: remove wrapper Enum<T> to directly return T in EnumArgument (#43)
1 parent 9e40384 commit 157fae5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/java/fr/traqueur/commands/impl/arguments/EnumArgument.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @param <T> The type of the enum.
1414
* @param <S> The type of the sender (e.g., player, console).
1515
*/
16-
public class EnumArgument<T extends Enum<T>, S> implements ArgumentConverter<Enum<T>>, TabCompleter<S> {
16+
public class EnumArgument<T extends Enum<T>, S> implements ArgumentConverter<T>, TabCompleter<S> {
1717

1818
/**
1919
* Creates a new EnumArgument instance for the specified enum class.
@@ -47,7 +47,7 @@ public EnumArgument(Class<T> clazz) {
4747
* @return The enum class
4848
*/
4949
@Override
50-
public Enum<T> apply(String s) {
50+
public T apply(String s) {
5151
if (s == null || s.isEmpty()) {
5252
return null;
5353
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=4.2.1
1+
version=4.2.2

0 commit comments

Comments
 (0)