mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Fix command registration
This commit is contained in:
1 parent
c7fdf9810d
commit
8fc11781b7
2 files changed
+5
-11
No files matched your search
+1
-1
@@ -54,7 +54,7 @@ public class SpyChannelCommand {
|
||||
commandManager.createDefaultCommandMeta())
|
||||
.withSenderType(ChatUser.class) // player
|
||||
.withPermission("carbonchat.spy")
|
||||
.argument(StaticArgument.required("*"))
|
||||
.argument(StaticArgument.required("everything"))
|
||||
.argument(BooleanArgument.required("enabled"))
|
||||
.handler(this::spyEverything)
|
||||
.build()
|
||||
|
||||
@@ -13,8 +13,8 @@ public final class CommandUtils {
|
||||
}
|
||||
|
||||
// TODO: turn this into a proper class that handles suggestions
|
||||
private static final CommandArgument<ChatUser, ChatChannel> channelArgument =
|
||||
CommandArgument.<ChatUser, ChatChannel>ofType(ChatChannel.class, "channel")
|
||||
public static CommandArgument<ChatUser, ChatChannel> channelArgument() {
|
||||
return CommandArgument.<ChatUser, ChatChannel>ofType(ChatChannel.class, "channel")
|
||||
.asRequired()
|
||||
.withParser((c, i) -> {
|
||||
final String input = i.peek();
|
||||
@@ -33,14 +33,11 @@ public final class CommandUtils {
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
public static CommandArgument<ChatUser, ChatChannel> channelArgument() {
|
||||
return channelArgument;
|
||||
}
|
||||
|
||||
// TODO: turn this into a proper class that handles suggestions
|
||||
private static final CommandArgument<ChatUser, ChatUser> chatUserArgument =
|
||||
CommandArgument.<ChatUser, ChatUser>ofType(ChatUser.class, "user")
|
||||
public static CommandArgument<ChatUser, ChatUser> chatUserArgument() {
|
||||
return CommandArgument.<ChatUser, ChatUser>ofType(ChatUser.class, "user")
|
||||
.asRequired()
|
||||
.withParser((c, i) -> {
|
||||
final String input = i.peek();
|
||||
@@ -59,9 +56,6 @@ public final class CommandUtils {
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
||||
public static CommandArgument<ChatUser, ChatUser> chatUserArgument() {
|
||||
return chatUserArgument;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user