mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Start documenting commands ingame
This commit is contained in:
4 files changed
+15
-2
No files matched your search
@@ -20,6 +20,7 @@
|
||||
package net.draycia.carbon.common.command.commands;
|
||||
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys;
|
||||
import com.google.inject.Inject;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
import net.draycia.carbon.api.users.CarbonPlayer;
|
||||
@@ -39,6 +40,7 @@ public class ClearChatCommand {
|
||||
final var command = commandManager.commandBuilder("clearchat", "chatclear", "cc")
|
||||
.permission("carbon.clearchat.clear")
|
||||
.senderType(PlayerCommander.class)
|
||||
.meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Clears the chat window for all players."))
|
||||
.handler(handler -> {
|
||||
// Not fond of having to send 50 messages to each player
|
||||
// Are we not able to just paste in 50 newlines and call it a day?
|
||||
|
||||
+5
-1
@@ -19,8 +19,10 @@
|
||||
*/
|
||||
package net.draycia.carbon.common.command.commands;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.arguments.standard.StringArgument;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys;
|
||||
import com.google.inject.Inject;
|
||||
import java.util.UUID;
|
||||
import net.draycia.carbon.api.CarbonChat;
|
||||
@@ -32,6 +34,7 @@ import net.draycia.carbon.common.command.PlayerCommander;
|
||||
import net.draycia.carbon.common.command.argument.CarbonPlayerArgument;
|
||||
import net.draycia.carbon.common.messages.CarbonMessageService;
|
||||
import net.draycia.carbon.common.util.CloudUtils;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
@@ -44,9 +47,10 @@ public class ContinueCommand {
|
||||
final CarbonChat carbonChat
|
||||
) {
|
||||
final var command = commandManager.commandBuilder("continue", "c")
|
||||
.argument(StringArgument.greedy("message"))
|
||||
.argument(StringArgument.greedy("message"), ArgumentDescription.of("The message to send."))
|
||||
.permission("carbon.whisper.continue") // TODO: carbon.whisper.spy
|
||||
.senderType(PlayerCommander.class)
|
||||
.meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Sends a message to the last person you messaged."))
|
||||
.handler(handler -> {
|
||||
final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer();
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
*/
|
||||
package net.draycia.carbon.common.command.commands;
|
||||
|
||||
import cloud.commandframework.ArgumentDescription;
|
||||
import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys;
|
||||
import com.google.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import net.draycia.carbon.api.users.CarbonPlayer;
|
||||
@@ -38,9 +40,11 @@ public class DebugCommand {
|
||||
final CarbonPlayerArgument carbonPlayerArgument
|
||||
) {
|
||||
final var command = commandManager.commandBuilder("carbondebug", "cdebug")
|
||||
.argument(carbonPlayerArgument.newInstance(false, "player"))
|
||||
.argument(carbonPlayerArgument.newInstance(false, "player"),
|
||||
ArgumentDescription.of("The player to check the groups of."))
|
||||
.permission("carbon.debug")
|
||||
.senderType(PlayerCommander.class)
|
||||
.meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Shows the permission groups of players."))
|
||||
.handler(handler -> {
|
||||
final CarbonPlayer sender = ((PlayerCommander) handler.getSender()).carbonPlayer();
|
||||
final CarbonPlayer target;
|
||||
|
||||
@@ -24,11 +24,13 @@ import cloud.commandframework.CommandManager;
|
||||
import cloud.commandframework.arguments.standard.StringArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.minecraft.extras.AudienceProvider;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftExtrasMetaKeys;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftHelp;
|
||||
import com.google.inject.Inject;
|
||||
import java.util.List;
|
||||
import net.draycia.carbon.common.command.Commander;
|
||||
import net.draycia.carbon.common.messages.CarbonMessageSource;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.Template;
|
||||
import net.kyori.adventure.text.minimessage.template.TemplateResolver;
|
||||
@@ -62,6 +64,7 @@ public final class HelpCommand {
|
||||
.withSuggestionsProvider(this::suggestQueries)
|
||||
.asOptional())
|
||||
.permission("carbon.help")
|
||||
.meta(MinecraftExtrasMetaKeys.DESCRIPTION, Component.text("Carbon command list."))
|
||||
.handler(this::execute)
|
||||
.build();
|
||||
|
||||
|
||||
Reference in new issue
Block a user