mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +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())
|
commandManager.createDefaultCommandMeta())
|
||||||
.withSenderType(ChatUser.class) // player
|
.withSenderType(ChatUser.class) // player
|
||||||
.withPermission("carbonchat.spy")
|
.withPermission("carbonchat.spy")
|
||||||
.argument(StaticArgument.required("*"))
|
.argument(StaticArgument.required("everything"))
|
||||||
.argument(BooleanArgument.required("enabled"))
|
.argument(BooleanArgument.required("enabled"))
|
||||||
.handler(this::spyEverything)
|
.handler(this::spyEverything)
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ public final class CommandUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: turn this into a proper class that handles suggestions
|
// TODO: turn this into a proper class that handles suggestions
|
||||||
private static final CommandArgument<ChatUser, ChatChannel> channelArgument =
|
public static CommandArgument<ChatUser, ChatChannel> channelArgument() {
|
||||||
CommandArgument.<ChatUser, ChatChannel>ofType(ChatChannel.class, "channel")
|
return CommandArgument.<ChatUser, ChatChannel>ofType(ChatChannel.class, "channel")
|
||||||
.asRequired()
|
.asRequired()
|
||||||
.withParser((c, i) -> {
|
.withParser((c, i) -> {
|
||||||
final String input = i.peek();
|
final String input = i.peek();
|
||||||
@@ -33,14 +33,11 @@ public final class CommandUtils {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static CommandArgument<ChatUser, ChatChannel> channelArgument() {
|
|
||||||
return channelArgument;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: turn this into a proper class that handles suggestions
|
// TODO: turn this into a proper class that handles suggestions
|
||||||
private static final CommandArgument<ChatUser, ChatUser> chatUserArgument =
|
public static CommandArgument<ChatUser, ChatUser> chatUserArgument() {
|
||||||
CommandArgument.<ChatUser, ChatUser>ofType(ChatUser.class, "user")
|
return CommandArgument.<ChatUser, ChatUser>ofType(ChatUser.class, "user")
|
||||||
.asRequired()
|
.asRequired()
|
||||||
.withParser((c, i) -> {
|
.withParser((c, i) -> {
|
||||||
final String input = i.peek();
|
final String input = i.peek();
|
||||||
@@ -59,9 +56,6 @@ public final class CommandUtils {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static CommandArgument<ChatUser, ChatUser> chatUserArgument() {
|
|
||||||
return chatUserArgument;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user