mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Add command help syntaxes
This commit is contained in:
1 parent
a9eb255e5d
commit
4b9d1eb8d2
12 files changed
+24
-18
No files matched your search
@@ -23,6 +23,7 @@ public class AliasedChannelCommand extends BaseCommand {
|
||||
}
|
||||
|
||||
@Default
|
||||
@Syntax("[message]")
|
||||
public void baseCommand(Player player, @Optional String[] args) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public class ChannelCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@chatchannel")
|
||||
@Syntax("<channel> [message]")
|
||||
public void baseCommand(Player player, @Conditions("canuse:true") ChatChannel channel, @Optional String[] args) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
@@ -38,6 +39,7 @@ public class ChannelCommand extends BaseCommand {
|
||||
@CommandPermission("carbonchat.switch.others")
|
||||
@Subcommand("other")
|
||||
@CommandCompletion("@chatchannel @players")
|
||||
@Syntax("<channel> <user>")
|
||||
public void baseCommand(CommandSender sender, @Conditions("exists:true") ChatChannel channel, ChatUser user) {
|
||||
user.setSelectedChannel(channel);
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package net.draycia.carbon.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Dependency;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.draycia.carbon.CarbonChat;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -22,6 +18,7 @@ public class IgnoreCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@players")
|
||||
@Syntax("<player>")
|
||||
public void baseCommand(Player player, ChatUser targetUser) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package net.draycia.carbon.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Dependency;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import net.draycia.carbon.CarbonChat;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
@@ -20,7 +17,12 @@ public class MeCommand extends BaseCommand {
|
||||
private CarbonChat carbonChat;
|
||||
|
||||
@Default
|
||||
@Syntax("<message>")
|
||||
public void baseCommand(Player player, String... args) {
|
||||
if (args == null || args.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String message = String.join(" ", args).replace("</pre>", "");
|
||||
String format = PlaceholderAPI.setPlaceholders(player, carbonChat.getConfig().getString("language.me"));
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package net.draycia.carbon.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Dependency;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.draycia.carbon.CarbonChat;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -19,6 +15,7 @@ public class MessageCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@players")
|
||||
@Syntax("<player> <message>")
|
||||
public void baseCommand(Player player, ChatUser targetUser, String... args) {
|
||||
if (args.length == 0) {
|
||||
return;
|
||||
|
||||
@@ -14,6 +14,7 @@ public class NicknameCommand extends BaseCommand {
|
||||
private CarbonChat carbonChat;
|
||||
|
||||
@Default
|
||||
@Syntax("<nickname> [player]")
|
||||
public void baseCommand(Player player, String nickname, @Optional ChatUser target) {
|
||||
ChatUser sender = carbonChat.getUserService().wrap(player);
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package net.draycia.carbon.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import co.aikar.commands.annotation.Dependency;
|
||||
import co.aikar.commands.annotation.*;
|
||||
import net.draycia.carbon.CarbonChat;
|
||||
import net.draycia.carbon.storage.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -18,6 +15,7 @@ public class ReplyCommand extends BaseCommand {
|
||||
private CarbonChat carbonChat;
|
||||
|
||||
@Default
|
||||
@Syntax("<message>")
|
||||
public void baseCommand(Player player, String... args) {
|
||||
if (args.length == 0) {
|
||||
return;
|
||||
|
||||
@@ -19,6 +19,7 @@ public class SetColorCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@chatchannel")
|
||||
@Syntax("<channel> <color>")
|
||||
public void baseCommand(Player player, @Conditions("canuse:true") ChatChannel channel, String color) {
|
||||
if (channel == null || color == null) {
|
||||
throw new ConditionFailedException("Channel or Color not supplied!");
|
||||
|
||||
@@ -17,6 +17,7 @@ public class SpyChannelCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@channel")
|
||||
@Syntax("<channel>")
|
||||
public void baseCommand(Player player, @Conditions("exists:true") ChatChannel channel) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public class ToggleCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@chatchannel @players")
|
||||
@Syntax("<channel>")
|
||||
public void baseCommand(Player player, @Conditions("canuse:true") ChatChannel channel) {
|
||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||
|
||||
@@ -40,6 +41,7 @@ public class ToggleCommand extends BaseCommand {
|
||||
@CommandPermission("carbonchat.toggle.others")
|
||||
@Subcommand("other")
|
||||
@CommandCompletion("@chatchannel @players")
|
||||
@Syntax("<channel> <player>")
|
||||
public void baseCommand(CommandSender sender, @Conditions("canuse:true") ChatChannel channel, ChatUser user) {
|
||||
String message;
|
||||
String otherMessage;
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package net.draycia.carbonmoderation.commands;
|
||||
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.Syntax;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.BaseCommand;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.CommandAlias;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.CommandCompletion;
|
||||
@@ -25,6 +26,7 @@ public class MuteCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@players")
|
||||
@Syntax("<player>")
|
||||
public void baseCommand(CommandSender sender, ChatUser targetUser) {
|
||||
Audience audience = moderation.getCarbonChat().getAdventureManager().getAudiences().audience(sender);
|
||||
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package net.draycia.carbonmoderation.commands;
|
||||
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.Syntax;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.BaseCommand;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.CommandAlias;
|
||||
import net.draycia.carbon.libs.co.aikar.commands.annotation.CommandCompletion;
|
||||
@@ -25,6 +26,7 @@ public class ShadowMuteCommand extends BaseCommand {
|
||||
|
||||
@Default
|
||||
@CommandCompletion("@players")
|
||||
@Syntax("<player>")
|
||||
public void baseCommand(CommandSender sender, ChatUser targetUser) {
|
||||
Audience audience = moderation.getCarbonChat().getAdventureManager().getAudiences().audience(sender);
|
||||
|
||||
|
||||
Reference in new issue
Block a user