Skip to content

Commit

Permalink
Add back missing admin permission to command
Browse files Browse the repository at this point in the history
Add some basic javadoc explaining command structure
  • Loading branch information
ApexModder committed Sep 7, 2024
1 parent b05e171 commit 1e4128c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/net/neoforged/neoforge/flag/FlagsCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,33 @@
import java.util.Set;
import java.util.stream.Collectors;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.commands.arguments.ResourceLocationArgument;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.HoverEvent;
import org.jetbrains.annotations.ApiStatus;

/**
* Command used for easy {@link Flag} manipulation.
* <p>
* This command requires permission level: {@link Commands#LEVEL_ADMINS}.
*
* <ul>
* <li>{@code /neoforge flags list} - Lists out all Enabled and Disabled {@link Flag Flags}</li>
* <li>{@code /neoforge flags enabled} - Lists out all Enabled {@link Flag Flags}</li>
* <li>{@code /neoforge flags disabled} - Lists out all Disabled {@link Flag Flags}</li>
* <li>{@code /neoforge flags set <flag> enabled} - Attempts to Enable the given {@link Flag}</li>
* <li>{@code /neoforge flags set <flag> disabled} - Attempts to Disable the given {@link Flag}</li>
* </ul>
* <em>Note:</em> Replace {@code <flag>} with any valid {@link Flag} identifier
*/
@ApiStatus.Internal
public interface FlagsCommand {
static ArgumentBuilder<CommandSourceStack, ?> register() {
return literal("flags")
.requires(src -> src.hasPermission(Commands.LEVEL_ADMINS))
.then(literal("list").executes(context -> {
listFlagsFor(context, true);
listFlagsFor(context, false);
Expand Down

0 comments on commit 1e4128c

Please sign in to comment.