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