Skip to content

Commit b6122bd

Browse files
committed
[+] Added string array command provider
1 parent 0693e78 commit b6122bd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/java/xyz/damt/command/provider/CommandProviderHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private final void init() {
3737
this.register(Float.class, new FloatCommandProvider());
3838
this.register(Boolean.class, new BooleanCommandProvider());
3939
this.register(Double.class, new DoubleCommandProvider());
40+
this.register(String[].class, new StringArrayCommandProvider());
4041

4142
this.register(Player.class, new PlayerCommandProvider(commandHandler.getJavaPlugin()));
4243
this.register(OfflinePlayer.class, new OfflinePlayerCommandProvider(commandHandler.getJavaPlugin()));
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package xyz.damt.command.provider.impl.normal;
2+
3+
import xyz.damt.command.exception.CommandProviderNullException;
4+
import xyz.damt.command.provider.CommandProvider;
5+
6+
public class StringArrayCommandProvider implements CommandProvider<String[]> {
7+
8+
@Override
9+
public String[] provide(String s) throws CommandProviderNullException {
10+
return s.split("\\s+");
11+
}
12+
13+
}

0 commit comments

Comments
 (0)